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;
106 int NoBlockSend(
const int*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
108 const unsigned long*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
109 int NoBlockSend(
const char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
111 const unsigned char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
112 int NoBlockSend(
const float*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
113 int NoBlockSend(
const double*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
114 int NoBlockSend(
const vtkTypeInt64*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
116 int NoBlockSend(
const int*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
118 const unsigned long*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
120 const char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
122 const unsigned char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
124 const float*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
126 const double*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
128 const vtkTypeInt64*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
134 int NoBlockSend(
const void*
data, vtkTypeInt64
length, MPI_Datatype mpiType,
int remoteProcessId,
145 int NoBlockReceive(
int*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
146 int NoBlockReceive(
unsigned long*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
147 int NoBlockReceive(
char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
148 int NoBlockReceive(
unsigned char*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
149 int NoBlockReceive(
float*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
150 int NoBlockReceive(
double*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
151 int NoBlockReceive(vtkTypeInt64*
data,
int length,
int remoteProcessId,
int tag,
Request& req);
153 int NoBlockReceive(
int*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
155 unsigned long*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
156 int NoBlockReceive(
char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
158 unsigned char*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
159 int NoBlockReceive(
float*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
160 int NoBlockReceive(
double*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
162 vtkTypeInt64*
data, vtkTypeInt64
length,
int remoteProcessId,
int tag,
Request& req);
171 void Barrier()
override;
174 int destProcessId)
override;
175 int GatherVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType sendLength,
178 int srcProcessId)
override;
179 int ScatterVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType* sendLengths,
181 int AllGatherVoidArray(
183 int AllGatherVVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType sendLength,
186 int operation,
int destProcessId)
override;
188 Operation* operation,
int destProcessId)
override;
189 int AllReduceVoidArray(
190 const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
int operation)
override;
191 int AllReduceVoidArray(
const void* sendBuffer,
void* recvBuffer,
vtkIdType length,
int type,
205 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource);
206 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
int*
type,
int*
size);
207 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
unsigned long*
type,
int*
size);
208 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
const char*
type,
int*
size);
209 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
float*
type,
int*
size);
210 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
double*
type,
int*
size);
212 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
int*
type, vtkTypeInt64*
size);
214 int source,
int tag,
int* flag,
int* actualSource,
unsigned long*
type, vtkTypeInt64*
size);
216 int source,
int tag,
int* flag,
int* actualSource,
const char*
type, vtkTypeInt64*
size);
217 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
float*
type, vtkTypeInt64*
size);
218 int Iprobe(
int source,
int tag,
int* flag,
int* actualSource,
double*
type, vtkTypeInt64*
size);
235 int Probe(
int source,
int tag,
int* actualSource)
override;
236 int Probe(
int source,
int tag,
int* actualSource,
int*
type,
int*
size);
237 int Probe(
int source,
int tag,
int* actualSource,
unsigned long*
type,
int*
size);
238 int Probe(
int source,
int tag,
int* actualSource,
const char*
type,
int*
size);
239 int Probe(
int source,
int tag,
int* actualSource,
float*
type,
int*
size);
240 int Probe(
int source,
int tag,
int* actualSource,
double*
type,
int*
size);
242 int Probe(
int source,
int tag,
int* actualSource,
int*
type, vtkTypeInt64*
size);
243 int Probe(
int source,
int tag,
int* actualSource,
unsigned long*
type, vtkTypeInt64*
size);
244 int Probe(
int source,
int tag,
int* actualSource,
const char*
type, vtkTypeInt64*
size);
245 int Probe(
int source,
int tag,
int* actualSource,
float*
type, vtkTypeInt64*
size);
246 int Probe(
int source,
int tag,
int* actualSource,
double*
type, vtkTypeInt64*
size);
253 int WaitAll(
int count, Request requests[]);
260 int WaitAny(
int count, Request requests[],
int& idx)
VTK_SIZEHINT(requests, count);
267 int WaitSome(
int count, Request requests[],
int& NCompleted,
int* completed)
275 int TestAll(
int count, Request requests[],
int& flag)
VTK_SIZEHINT(requests, count);
280 int TestAny(
int count, Request requests[],
int& idx,
int& flag)
VTK_SIZEHINT(requests, count);
288 int TestSome(
int count, Request requests[],
int& NCompleted,
int* completed)
293 vtkMPICommunicatorOpaqueComm*
GetMPIComm() {
return this->MPIComm; }
295 int InitializeExternal(vtkMPICommunicatorOpaqueComm* comm);
297 static char* Allocate(
size_t size);
298 static void Free(
char* ptr);
305 vtkSetClampMacro(UseSsend,
int, 0, 1);
306 vtkGetMacro(UseSsend,
int);
307 vtkBooleanMacro(UseSsend,
int);
325 int InitializeNumberOfProcesses();
338 vtkSetMacro(KeepHandle,
int);
339 vtkBooleanMacro(KeepHandle,
int);
361 virtual int ReceiveDataInternal(
char*
data,
int length,
int sizeoftype,
int remoteProcessId,
362 int tag, vtkMPICommunicatorReceiveDataInfo*
info,
int useCopy,
int& senderId);
363 virtual int ReceiveDataInternal(
char*
data, vtkTypeInt64
length,
int sizeoftype,
364 int remoteProcessId,
int tag, vtkMPICommunicatorReceiveDataInfo*
info,
int useCopy,
375 static int CheckForMPIError(
int err);
382 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.
#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()