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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 790 - (show annotations)
Wed Jul 26 23:12:34 2006 UTC (13 years, 6 months ago) by bcumming
File MIME type: text/plain
File size: 2105 byte(s)
changes to escript/py_src/pdetools.py and /escript/src/Data.h/.cpp to
make the Locator work in MPI. escript::Data::mindp now returns a 3 tuple,
with the MPI rank of the process on which the minimum value occurs
included. escript::Data::convertToNumArrayFromDPNo also takes the ProcNo
to perform the MPI reduction.

This had to be implemented in both the MPI and non-MPI versions to allow
the necesary changes to the Python code in pdetools.py. In the non-MPI
version ProcNo is set to 0. This works for the explicit scripts tested
thus far, however if it causes problems in your scripts contact Ben or
Lutz, or revert the three files (pdetools.py, Data.h and Data.cpp) to
the previous version.  


1 #ifdef PASO_MPI
2
3 #ifndef INC_COMMBUFFER
4 #define INC_COMMBUFFER
5
6 #include "Paso.h"
7 #include "Paso_MPI.h"
8
9 #define TRACE_COMMBUFFER
10
11 /***********************************
12 * TYPE DEFINITIONS
13 ***********************************/
14
15 /* buffer for communication */
16 typedef struct Paso_CommBuffer
17 {
18 Paso_MPIInfo *MPIInfo;
19 index_t reference_counter;
20
21 void **bufferForward;
22 void **bufferBackward;
23 dim_t *numForward;
24 dim_t *numBackward;
25 size_t maxItemSize;
26 dim_t *requestedRecvLength;
27
28 /* the source/target domains for the buffer */
29 dim_t numDomains;
30 index_t *domains;
31 index_t *indexDomains;
32
33 MPI_Status *statusForward;
34 MPI_Request *requestForward;
35 MPI_Status *statusBackward;
36 MPI_Request *requestBackward;
37
38 int tag; /* tag used for sends a receives for this buffer */
39 } Paso_CommBuffer;
40
41
42
43 /***********************************
44 * PROTOTYPES
45 ***********************************/
46
47 Paso_CommBuffer* Paso_CommBuffer_alloc( Paso_MPIInfo *MPIInfo, int tag );
48 Paso_CommBuffer* Paso_CommBuffer_getReference( Paso_CommBuffer *in );
49 void Paso_CommBuffer_dealloc( Paso_CommBuffer *in );
50 void Paso_CommBuffer_allocTable( Paso_CommBuffer *in, size_t itemSize, index_t *numForward, index_t *numBackward, dim_t numDomains, index_t *domains );
51 bool_t Paso_CommBuffer_recv( Paso_CommBuffer *in, index_t dom, size_t itemSize );
52 bool_t Paso_CommBuffer_recvAny( Paso_CommBuffer *in, index_t *dom, size_t itemSize );
53 bool_t Paso_CommBuffer_send( Paso_CommBuffer *in, index_t dom, size_t itemSize );
54 bool_t Paso_CommBuffer_waitSendPending( Paso_CommBuffer *in );
55 bool_t Paso_CommBuffer_waitSend( Paso_CommBuffer *in, index_t dom );
56 bool_t Paso_CommBuffer_waitRecvPending( Paso_CommBuffer *in );
57 bool_t Paso_CommBuffer_waitRecv( Paso_CommBuffer *in, index_t dom );
58 void Paso_CommBuffer_pack( Paso_CommBuffer *in, index_t dom, index_t *index, void *data, size_t itemSize, dim_t offset );
59 void Paso_CommBuffer_unpack( Paso_CommBuffer *in, index_t dom, index_t *index, void *data, size_t itemSize, dim_t offset );
60 bool_t Paso_CommBuffer_validate( Paso_CommBuffer *in );
61
62 #endif
63
64 #endif

  ViewVC Help
Powered by ViewVC 1.1.26