38 #ifndef __vtkMPICommunicator_h
39 #define __vtkMPICommunicator_h
41 #include "vtkParallelMPIModule.h"
47 class vtkMPICommunicatorOpaqueComm;
48 class vtkMPICommunicatorOpaqueRequest;
49 class vtkMPICommunicatorReceiveDataInfo;
66 vtkMPICommunicatorOpaqueRequest*
Req;
72 void PrintSelf(ostream& os,
vtkIndent indent);
96 virtual int SendVoidArray(
const void *data,
vtkIdType length,
int type,
97 int remoteProcessId,
int tag);
98 virtual int ReceiveVoidArray(
void *data,
vtkIdType length,
int type,
99 int remoteProcessId,
int tag);
108 int NoBlockSend(
const int* data,
int length,
int remoteProcessId,
int tag,
110 int NoBlockSend(
const unsigned long* data,
int length,
int remoteProcessId,
112 int NoBlockSend(
const char* data,
int length,
int remoteProcessId,
114 int NoBlockSend(
const unsigned char* data,
int length,
int remoteProcessId,
116 int NoBlockSend(
const float* data,
int length,
int remoteProcessId,
118 int NoBlockSend(
const double* data,
int length,
int remoteProcessId,
127 int NoBlockReceive(
int* data,
int length,
int remoteProcessId,
129 int NoBlockReceive(
unsigned long* data,
int length,
130 int remoteProcessId,
int tag,
Request& req);
131 int NoBlockReceive(
char* data,
int length,
int remoteProcessId,
133 int NoBlockReceive(
unsigned char* data,
int length,
int remoteProcessId,
135 int NoBlockReceive(
float* data,
int length,
int remoteProcessId,
137 int NoBlockReceive(
double* data,
int length,
int remoteProcessId,
139 #ifdef VTK_USE_64BIT_IDS
140 int NoBlockReceive(
vtkIdType* data,
int length,
int remoteProcessId,
150 virtual void Barrier();
151 virtual int BroadcastVoidArray(
void *data,
vtkIdType length,
int type,
153 virtual int GatherVoidArray(
const void *sendBuffer,
void *recvBuffer,
154 vtkIdType length,
int type,
int destProcessId);
155 virtual int GatherVVoidArray(
const void *sendBuffer,
void *recvBuffer,
157 vtkIdType *offsets,
int type,
int destProcessId);
158 virtual int ScatterVoidArray(
const void *sendBuffer,
void *recvBuffer,
159 vtkIdType length,
int type,
int srcProcessId);
160 virtual int ScatterVVoidArray(
const void *sendBuffer,
void *recvBuffer,
164 virtual int AllGatherVoidArray(
const void *sendBuffer,
void *recvBuffer,
166 virtual int AllGatherVVoidArray(
const void *sendBuffer,
void *recvBuffer,
169 virtual int ReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
171 int operation,
int destProcessId);
172 virtual int ReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
174 Operation *operation,
int destProcessId);
175 virtual int AllReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
178 virtual int AllReduceVoidArray(
const void *sendBuffer,
void *recvBuffer,
191 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource);
192 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
193 int* type,
int* size);
194 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
195 unsigned long* type,
int* size);
196 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
197 const char* type,
int* size);
198 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
199 float* type,
int* size);
200 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
201 double* type,
int* size);
206 int WaitAll(
const int count,
Request requests[]);
211 int WaitAny(
const int count,
Request requests[],
int& idx);
218 const int count,
Request requests[],
int &NCompleted,
int *completed );
224 int TestAll(
const int count,
Request requests[],
int& flag );
227 int TestAny(
const int count,
Request requests[],
int &idx,
int &flag );
234 int TestSome(
const int count,
Request requests[],
235 int& NCompleted,
int *completed);
243 return this->MPIComm;
246 int InitializeExternal(vtkMPICommunicatorOpaqueComm *comm);
250 static char* Allocate(
size_t size);
251 static void Free(
char* ptr);
257 vtkSetClampMacro(UseSsend,
int, 0, 1);
258 vtkGetMacro(UseSsend,
int);
259 vtkBooleanMacro(UseSsend,
int);
275 int InitializeNumberOfProcesses();
285 vtkSetMacro(KeepHandle,
int);
286 vtkBooleanMacro(KeepHandle,
int);
304 virtual int ReceiveDataInternal(
305 char* data,
int length,
int sizeoftype,
306 int remoteProcessId,
int tag,
307 vtkMPICommunicatorReceiveDataInfo* info,
308 int useCopy,
int& senderId);
318 static int CheckForMPIError(
int err);
vtkMPICommunicatorOpaqueRequest * Req
static vtkMPICommunicator * WorldCommunicator
Class for creating user defined MPI communicators.
vtkMPICommunicatorOpaqueComm * MPIComm
a simple class to control print indentation
A subgroup of processes from a communicator.
Process communication using MPI.
Used to send/receive messages in a multiprocess environment.
vtkMPICommunicatorOpaqueComm * GetMPIComm()