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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2068 - (show annotations)
Thu Nov 20 09:11:01 2008 UTC (10 years, 11 months ago) by phornby
File MIME type: text/plain
File size: 2476 byte(s)
Interim commit getting paso ready for becoming a shared library.


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * 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
14
15 /**************************************************************/
16
17 /* Paso: coupler */
18
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22
23 /**************************************************************/
24
25 #ifndef INC_PASO_COUPLER
26 #define INC_PASO_COUPLER
27
28 #include "SharedComponents.h"
29 /**************************************************************/
30
31 typedef struct Paso_Connector {
32
33 Paso_SharedComponents* send;
34 Paso_SharedComponents* recv;
35 dim_t reference_counter;
36 Paso_MPIInfo *mpi_info;
37
38 } Paso_Connector;
39 typedef struct Paso_Coupler {
40
41 dim_t block_size;
42
43 Paso_Connector* connector;
44
45 double *data; /* unmanaged pointer to data be send */
46 double *send_buffer;
47 double *recv_buffer;
48 #ifdef PASO_MPI
49 MPI_Request* mpi_requests;
50 MPI_Status* mpi_stati;
51 #else
52 void* mpi_requests;
53 void* mpi_stati;
54 #endif
55
56 dim_t reference_counter;
57 Paso_MPIInfo *mpi_info;
58
59 } Paso_Coupler;
60
61
62
63 PASO_DLL_API
64 Paso_Connector* Paso_Connector_alloc(Paso_SharedComponents * send, Paso_SharedComponents* recv);
65
66 PASO_DLL_API
67 Paso_Connector* Paso_Connector_getReference(Paso_Connector*);
68
69 PASO_DLL_API
70 Paso_Connector* Paso_Connector_unroll(Paso_Connector* in, index_t block_size);
71
72 PASO_DLL_API
73 Paso_Connector* Paso_Connector_copy(Paso_Connector* in);
74
75 PASO_DLL_API
76 void Paso_Connector_free(Paso_Connector*);
77
78
79 PASO_DLL_API
80 Paso_Coupler* Paso_Coupler_alloc(Paso_Connector*, dim_t blockSize);
81
82 PASO_DLL_API
83 Paso_Coupler* Paso_Coupler_getReference(Paso_Coupler*);
84
85 PASO_DLL_API
86 void Paso_Coupler_startCollect(Paso_Coupler* self,const double* in);
87
88 PASO_DLL_API
89 double* Paso_Coupler_finishCollect(Paso_Coupler* self);
90
91 PASO_DLL_API
92 void Paso_Coupler_free(Paso_Coupler* in);
93
94 #define Paso_Coupler_borrowLocalData(_in_) (_in_)->data
95 #define Paso_Coupler_borrowRemoteData(_in_) (_in_)->recv_buffer
96
97 PASO_DLL_API
98 void Paso_Coupler_copyAll(const Paso_Coupler* src, Paso_Coupler* target);
99
100 PASO_DLL_API
101 dim_t Paso_Coupler_getLocalLength(const Paso_Coupler* in);
102 #endif

  ViewVC Help
Powered by ViewVC 1.1.26