39 #ifndef vtkMPICommunicator_h
40 #define vtkMPICommunicator_h
43 #include "vtkParallelMPIModule.h"
48 class vtkMPICommunicatorOpaqueComm;
49 class vtkMPICommunicatorOpaqueRequest;
50 class vtkMPICommunicatorReceiveDataInfo;
65 vtkMPICommunicatorOpaqueRequest*
Req;
69 void PrintSelf(ostream& os,
vtkIndent indent)
override;
103 int ReceiveVoidArray(
116 int NoBlockSend(
const int*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
118 const unsigned long*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
119 int NoBlockSend(
const char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
121 const unsigned char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
122 int NoBlockSend(
const float*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
123 int NoBlockSend(
const double*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
124 #ifdef VTK_USE_64BIT_IDS
137 int NoBlockReceive(
int*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
138 int NoBlockReceive(
unsigned long*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
139 int NoBlockReceive(
char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
140 int NoBlockReceive(
unsigned char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
141 int NoBlockReceive(
float*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
142 int NoBlockReceive(
double*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
143 #ifdef VTK_USE_64BIT_IDS
154 void Barrier()
override;
157 int destProcessId)
override;
158 int GatherVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType sendLength,
161 int srcProcessId)
override;
162 int ScatterVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType* sendLengths,
164 int AllGatherVoidArray(
166 int AllGatherVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType sendLength,
169 int operation,
int destProcessId)
override;
171 Operation* operation,
int destProcessId)
override;
172 int AllReduceVoidArray(
173 const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
int operation)
override;
174 int AllReduceVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
188 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource);
189 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
int*
type,
int*
size);
190 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
unsigned long*
type,
int*
size);
191 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
const char*
type,
int*
size);
192 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
float*
type,
int*
size);
193 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
double*
type,
int*
size);
200 int WaitAll(
const int count,
Request requests[]);
214 int WaitSome(
const int count,
Request requests[],
int& NCompleted,
int* completed)
227 int TestAny(
const int count,
Request requests[],
int& idx,
int& flag)
236 int TestSome(
const int count,
Request requests[],
int& NCompleted,
int* completed)
241 vtkMPICommunicatorOpaqueComm*
GetMPIComm() {
return this->MPIComm; }
243 int InitializeExternal(vtkMPICommunicatorOpaqueComm* comm);
245 static char* Allocate(
size_t size);
246 static void Free(
char* ptr);
253 vtkSetClampMacro(UseSsend,
int, 0, 1);
254 vtkGetMacro(UseSsend,
int);
255 vtkBooleanMacro(UseSsend,
int);
273 int InitializeNumberOfProcesses();
286 vtkSetMacro(KeepHandle,
int);
287 vtkBooleanMacro(KeepHandle,
int);
308 virtual int ReceiveDataInternal(
char*
data,
int length,
int sizeoftype,
int remoteProcessId,
309 int tag, vtkMPICommunicatorReceiveDataInfo*
info,
int useCopy,
int& senderId);
318 static int CheckForMPIError(
int err);
A custom operation to use in a reduce command.
vtkMPICommunicatorOpaqueRequest * Req
static vtkMPICommunicator * WorldCommunicator
Class for creating user defined MPI communicators.
vtkMPICommunicatorOpaqueComm * MPIComm
a simple class to control print indentation
int Test(int argc, char *argv[], const char *dfile, const InitializationCallback &initCallback)
A subgroup of processes from a communicator.
Process communication using MPI.
#define VTK_SIZEHINT(...)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Used to send/receive messages in a multiprocess environment.
vtkMPICommunicatorOpaqueComm * GetMPIComm()