Go to the documentation of this file.
39 #ifndef vtkMPICommunicator_h
40 #define vtkMPICommunicator_h
42 #include "vtkParallelMPIModule.h"
48 class vtkMPICommunicatorOpaqueComm;
49 class vtkMPICommunicatorOpaqueRequest;
50 class vtkMPICommunicatorReceiveDataInfo;
66 vtkMPICommunicatorOpaqueRequest*
Req;
104 int remoteProcessId,
int tag)
override;
106 int remoteProcessId,
int tag)
override;
130 #ifdef VTK_USE_64BIT_IDS
147 int remoteProcessId,
int tag,
Request& req);
156 #ifdef VTK_USE_64BIT_IDS
171 int srcProcessId)
override;
182 int srcProcessId)
override;
190 int operation,
int destProcessId)
override;
193 Operation *operation,
int destProcessId)
override;
196 int operation)
override;
244 const int count,
Request requests[],
int &NCompleted,
int *completed )
VTK_SIZEHINT(requests, count);
265 int& NCompleted,
int *completed)
VTK_SIZEHINT(requests, count);
271 return this->MPIComm;
285 vtkSetClampMacro(UseSsend,
int, 0, 1);
286 vtkGetMacro(UseSsend,
int);
287 vtkBooleanMacro(UseSsend,
int);
318 vtkSetMacro(KeepHandle,
int);
319 vtkBooleanMacro(KeepHandle,
int);
343 int remoteProcessId,
int tag,
344 vtkMPICommunicatorReceiveDataInfo*
info,
345 int useCopy,
int& senderId);
virtual void Barrier() override
More efficient implementations of collective operations that use the equivalent MPI commands.
static int CheckForMPIError(int err)
int TestAll(const int count, Request requests[], int &flag)
Checks if the given communication request objects are complete.
void Duplicate(vtkMPICommunicator *source)
Copies all the attributes of source, deleting previously stored data EXCEPT the MPI communicator hand...
int WaitSome(const int count, Request requests[], int &NCompleted, int *completed)
Blocks until one or more of the specified requests in the given request request array completes.
virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation, int destProcessId) override
int NoBlockReceive(unsigned char *data, int length, int remoteProcessId, int tag, Request &req)
int NoBlockReceive(float *data, int length, int remoteProcessId, int tag, Request &req)
Used to send/receive messages in a multiprocess environment.
int Initialize(vtkProcessGroup *group)
Used to initialize the communicator (i.e.
int NoBlockSend(const unsigned char *data, int length, int remoteProcessId, int tag, Request &req)
A custom operation to use in a reduce command.
virtual int AllGatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type) override
int NoBlockSend(const float *data, int length, int remoteProcessId, int tag, Request &req)
virtual int ReceiveVoidArray(void *data, vtkIdType length, int type, int remoteProcessId, int tag) override
Subclasses have to supply this method to receive various arrays of data.
int NoBlockReceive(char *data, int length, int remoteProcessId, int tag, Request &req)
virtual int ScatterVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType *sendLengths, vtkIdType *offsets, vtkIdType recvLength, int type, int srcProcessId) override
Class for creating user defined MPI communicators.
static char * Allocate(size_t size)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
static vtkMPICommunicator * New()
Creates an empty communicator.
int WaitAny(const int count, Request requests[], int &idx)
Blocks until one of the specified requests in the given request array completes.
int NoBlockReceive(unsigned long *data, int length, int remoteProcessId, int tag, Request &req)
virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation) override
#define VTK_SIZEHINT(...)
int WaitAll(const int count, Request requests[])
Given the request objects of a set of non-blocking operations (send and/or receive) this method block...
int InitializeNumberOfProcesses()
int Iprobe(int source, int tag, int *flag, int *actualSource, float *type, int *size)
void InitializeCopy(vtkMPICommunicator *source)
static vtkMPICommunicator * WorldCommunicator
int Iprobe(int source, int tag, int *flag, int *actualSource)
Nonblocking test for a message.
a simple class to control print indentation
virtual int GatherVVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType sendLength, vtkIdType *recvLengths, vtkIdType *offsets, int type, int destProcessId) override
int TestSome(const int count, Request requests[], int &NCompleted, int *completed)
Checks the status of all the given request communication object handles.
int Iprobe(int source, int tag, int *flag, int *actualSource, unsigned long *type, int *size)
int Iprobe(int source, int tag, int *flag, int *actualSource, int *type, int *size)
int NoBlockSend(const int *data, int length, int remoteProcessId, int tag, Request &req)
This method sends data to another process (non-blocking).
static vtkMPICommunicator * GetWorldCommunicator()
Returns the singleton which behaves as the global communicator (MPI_COMM_WORLD)
virtual int ReceiveDataInternal(char *data, int length, int sizeoftype, int remoteProcessId, int tag, vtkMPICommunicatorReceiveDataInfo *info, int useCopy, int &senderId)
Implementation for receive data.
int NoBlockReceive(int *data, int length, int remoteProcessId, int tag, Request &req)
This method receives data from a corresponding send (non-blocking).
void CopyFrom(vtkMPICommunicator *source)
Copies all the attributes of source, deleting previously stored data.
int NoBlockReceive(double *data, int length, int remoteProcessId, int tag, Request &req)
static void Free(char *ptr)
virtual int GatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int destProcessId) override
virtual int AllGatherVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type) override
A subgroup of processes from a communicator.
virtual int SendVoidArray(const void *data, vtkIdType length, int type, int remoteProcessId, int tag) override
Performs the actual communication.
int TestAny(const int count, Request requests[], int &idx, int &flag)
Check if at least one of the specified requests has completed.
int InitializeExternal(vtkMPICommunicatorOpaqueComm *comm)
virtual int ReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, Operation *operation, int destProcessId) override
int Iprobe(int source, int tag, int *flag, int *actualSource, double *type, int *size)
vtkMPICommunicatorOpaqueComm * MPIComm
vtkMPICommunicatorOpaqueComm * GetMPIComm()
int NoBlockSend(const unsigned long *data, int length, int remoteProcessId, int tag, Request &req)
Process communication using MPI.
virtual int ScatterVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int srcProcessId) override
vtkMPICommunicatorOpaqueRequest * Req
int Iprobe(int source, int tag, int *flag, int *actualSource, const char *type, int *size)
int NoBlockSend(const double *data, int length, int remoteProcessId, int tag, Request &req)
int SplitInitialize(vtkCommunicator *oldcomm, int color, int key)
Used to initialize the communicator (i.e.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int BroadcastVoidArray(void *data, vtkIdType length, int type, int srcProcessId) override
Subclasses should reimplement these if they have a more efficient implementation.
virtual int AllReduceVoidArray(const void *sendBuffer, void *recvBuffer, vtkIdType length, int type, int operation) override
int NoBlockSend(const char *data, int length, int remoteProcessId, int tag, Request &req)