27 #ifndef vtkMPICommunicator_h
28 #define vtkMPICommunicator_h
32 #include "vtkParallelMPIModule.h"
34 VTK_ABI_NAMESPACE_BEGIN
38 class vtkMPICommunicatorOpaqueComm;
39 class vtkMPICommunicatorOpaqueRequest;
40 class vtkMPICommunicatorReceiveDataInfo;
55 vtkMPICommunicatorOpaqueRequest*
Req;
59 void PrintSelf(ostream& os,
vtkIndent indent)
override;
83 void InitializeAttributes();
100 int ReceiveVoidArray(
113 int NoBlockSend(
const int*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
115 const unsigned long*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
116 int NoBlockSend(
const char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
118 const unsigned char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
119 int NoBlockSend(
const float*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
120 int NoBlockSend(
const double*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
121 int NoBlockSend(
const vtkTypeInt64*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
123 int NoBlockSend(
const int*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
125 const unsigned long*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
127 const char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
129 const unsigned char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
131 const float*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
133 const double*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
135 const vtkTypeInt64*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
141 int NoBlockSend(
const void*
data, vtkTypeInt64
length, MPI_Datatype mpiType,
int remoteProcessId,
152 int NoBlockReceive(
int*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
153 int NoBlockReceive(
unsigned long*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
154 int NoBlockReceive(
char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
155 int NoBlockReceive(
unsigned char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
156 int NoBlockReceive(
float*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
157 int NoBlockReceive(
double*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
158 int NoBlockReceive(vtkTypeInt64*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
160 int NoBlockReceive(
int*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
162 unsigned long*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
163 int NoBlockReceive(
char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
165 unsigned char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
166 int NoBlockReceive(
float*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
167 int NoBlockReceive(
double*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
169 vtkTypeInt64*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
175 int AllToAllVVoidArray(
const void* sendBuffer,
const int* sendCounts,
const int* sendOffsets,
176 void* recvBuffer,
const int* recvCounts,
const int* recvOffsets,
int type)
override;
184 void Barrier()
override;
187 int destProcessId)
override;
188 int GatherVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType sendLength,
191 int srcProcessId)
override;
192 int ScatterVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType* sendLengths,
194 int AllGatherVoidArray(
196 int AllGatherVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType sendLength,
199 int operation,
int destProcessId)
override;
201 Operation* operation,
int destProcessId)
override;
202 int AllReduceVoidArray(
203 const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
int operation)
override;
204 int AllReduceVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
218 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource);
219 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
int*
type,
int*
size);
220 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
unsigned long*
type,
int*
size);
221 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
const char*
type,
int*
size);
222 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
float*
type,
int*
size);
223 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
double*
type,
int*
size);
225 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
int*
type, vtkTypeInt64*
size);
227 int source,
int tag,
int* flag,
int* actualSource,
unsigned long*
type, vtkTypeInt64*
size);
229 int source,
int tag,
int* flag,
int* actualSource,
const char*
type, vtkTypeInt64*
size);
230 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
float*
type, vtkTypeInt64*
size);
231 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
double*
type, vtkTypeInt64*
size);
248 int Probe(
int source,
int tag,
int* actualSource)
override;
249 int Probe(
int source,
int tag,
int* actualSource,
int*
type,
int*
size);
250 int Probe(
int source,
int tag,
int* actualSource,
unsigned long*
type,
int*
size);
251 int Probe(
int source,
int tag,
int* actualSource,
const char*
type,
int*
size);
252 int Probe(
int source,
int tag,
int* actualSource,
float*
type,
int*
size);
253 int Probe(
int source,
int tag,
int* actualSource,
double*
type,
int*
size);
255 int Probe(
int source,
int tag,
int* actualSource,
int*
type, vtkTypeInt64*
size);
256 int Probe(
int source,
int tag,
int* actualSource,
unsigned long*
type, vtkTypeInt64*
size);
257 int Probe(
int source,
int tag,
int* actualSource,
const char*
type, vtkTypeInt64*
size);
258 int Probe(
int source,
int tag,
int* actualSource,
float*
type, vtkTypeInt64*
size);
259 int Probe(
int source,
int tag,
int* actualSource,
double*
type, vtkTypeInt64*
size);
266 int WaitAll(
int count, Request requests[]);
273 int WaitAny(
int count, Request requests[],
int& idx)
VTK_SIZEHINT(requests, count);
280 int WaitSome(
int count, Request requests[],
int& NCompleted,
int* completed)
288 int TestAll(
int count, Request requests[],
int& flag)
VTK_SIZEHINT(requests, count);
293 int TestAny(
int count, Request requests[],
int& idx,
int& flag)
VTK_SIZEHINT(requests, count);
301 int TestSome(
int count, Request requests[],
int& NCompleted,
int* completed)
306 vtkMPICommunicatorOpaqueComm*
GetMPIComm() {
return this->MPIComm; }
308 int InitializeExternal(vtkMPICommunicatorOpaqueComm* comm);
310 static char* Allocate(
size_t size);
311 static void Free(
char* ptr);
318 vtkSetClampMacro(UseSsend,
int, 0, 1);
319 vtkGetMacro(UseSsend,
int);
320 vtkBooleanMacro(UseSsend,
int);
338 int InitializeNumberOfProcesses();
351 vtkSetMacro(KeepHandle,
int);
352 vtkBooleanMacro(KeepHandle,
int);
374 virtual int ReceiveDataInternal(
char*
data,
int length,
int sizeoftype,
int remoteProcessId,
375 int tag, vtkMPICommunicatorReceiveDataInfo*
info,
int useCopy,
int& senderId);
376 virtual int ReceiveDataInternal(
char*
data, vtkTypeInt64
length,
int sizeoftype,
377 int remoteProcessId,
int tag, vtkMPICommunicatorReceiveDataInfo*
info,
int useCopy,
390 static int CheckForMPIError(
int err);
407 VTK_ABI_NAMESPACE_END
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.
int GetTagMaxValue() const override
Overrides the base function to return the maximum value for a tag supported by 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.
bool CanProbe() override
Check if this communicator implements a probe operation (always true for MPI communicator) ...
vtkMPICommunicatorOpaqueComm * GetMPIComm()