/[escript]/trunk/paso/src/Coupler.h
ViewVC logotype

Annotation of /trunk/paso/src/Coupler.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3482 - (hide annotations)
Wed Mar 23 04:06:52 2011 UTC (8 years, 6 months ago) by gross
File MIME type: text/plain
File size: 3124 byte(s)
some work on AMG MPI
1 ksteube 1313
2     /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1313
14 ksteube 1811
15 ksteube 1313 /**************************************************************/
16    
17     /* Paso: coupler */
18    
19     /**************************************************************/
20    
21 jfenwick 2608 /* Author: Lutz Gross, l.gross@uq.edu.au */
22 ksteube 1313
23     /**************************************************************/
24    
25     #ifndef INC_PASO_COUPLER
26     #define INC_PASO_COUPLER
27    
28     #include "SharedComponents.h"
29     /**************************************************************/
30    
31 gross 1552 typedef struct Paso_Connector {
32    
33     Paso_SharedComponents* send;
34     Paso_SharedComponents* recv;
35     dim_t reference_counter;
36 jfenwick 3259 Esys_MPIInfo *mpi_info;
37 gross 1552
38     } Paso_Connector;
39 ksteube 1313 typedef struct Paso_Coupler {
40    
41     dim_t block_size;
42    
43 gross 1552 Paso_Connector* connector;
44    
45 gross 3458 bool_t in_use;
46 gross 1562 double *data; /* unmanaged pointer to data be send */
47 ksteube 1313 double *send_buffer;
48     double *recv_buffer;
49 jfenwick 3259 #ifdef ESYS_MPI
50 ksteube 1313 MPI_Request* mpi_requests;
51     MPI_Status* mpi_stati;
52     #else
53     void* mpi_requests;
54     void* mpi_stati;
55     #endif
56    
57     dim_t reference_counter;
58 jfenwick 3259 Esys_MPIInfo *mpi_info;
59 ksteube 1313
60     } Paso_Coupler;
61    
62    
63 phornby 2068
64     PASO_DLL_API
65 gross 1552 Paso_Connector* Paso_Connector_alloc(Paso_SharedComponents * send, Paso_SharedComponents* recv);
66 phornby 2068
67     PASO_DLL_API
68 gross 1552 Paso_Connector* Paso_Connector_getReference(Paso_Connector*);
69 phornby 2068
70     PASO_DLL_API
71 gross 1552 Paso_Connector* Paso_Connector_unroll(Paso_Connector* in, index_t block_size);
72 phornby 2068
73     PASO_DLL_API
74 gross 1552 Paso_Connector* Paso_Connector_copy(Paso_Connector* in);
75 phornby 2068
76     PASO_DLL_API
77 gross 1552 void Paso_Connector_free(Paso_Connector*);
78    
79 phornby 2068
80     PASO_DLL_API
81 gross 1552 Paso_Coupler* Paso_Coupler_alloc(Paso_Connector*, dim_t blockSize);
82 phornby 2068
83     PASO_DLL_API
84 ksteube 1313 Paso_Coupler* Paso_Coupler_getReference(Paso_Coupler*);
85 phornby 2068
86     PASO_DLL_API
87 gross 1639 void Paso_Coupler_startCollect(Paso_Coupler* self,const double* in);
88 phornby 2068
89     PASO_DLL_API
90 ksteube 1313 double* Paso_Coupler_finishCollect(Paso_Coupler* self);
91 phornby 2068
92     PASO_DLL_API
93 gross 1552 void Paso_Coupler_free(Paso_Coupler* in);
94 phornby 2068
95 gross 1562 #define Paso_Coupler_borrowLocalData(_in_) (_in_)->data
96     #define Paso_Coupler_borrowRemoteData(_in_) (_in_)->recv_buffer
97 gross 3445 #define Paso_Coupler_getNumSharedComponents(_in_) ((_in_)->connector->send->numSharedComponents)
98     #define Paso_Coupler_getNumOverlapComponents(_in_) ((_in_)->connector->recv->numSharedComponents)
99     #define Paso_Coupler_getNumSharedValues(_in_) ( Paso_Coupler_getNumSharedComponents(_in_) * (_in_)->block_size )
100     #define Paso_Coupler_getNumOverlapValues(_in_) ( Paso_Coupler_getNumOverlapComponents(_in_) * (_in_)->block_size )
101     #define Paso_Coupler_getLocalLength(_in_) ( (_in_)->connector->send->local_length )
102 phornby 2068
103     PASO_DLL_API
104 gross 1562 void Paso_Coupler_copyAll(const Paso_Coupler* src, Paso_Coupler* target);
105 phornby 2068
106 gross 3442
107     PASO_DLL_API
108 gross 3482 void Paso_Coupler_fillOverlap(const dim_t n, double* x, Paso_Coupler *coupler);
109 gross 3442
110     PASO_DLL_API
111 gross 3445 void Paso_Coupler_max(const dim_t n, double* x, Paso_Coupler *coupler);
112 gross 3442
113    
114 ksteube 1313 #endif

  ViewVC Help
Powered by ViewVC 1.1.26