Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::MPIAccess Class Reference

Public Member Functions

int barrier ()
 
int cancel (int RecvRequestId, int &flag)
 
int cancel (int source, int MPITag, MPI_Datatype datatype, int outcount, int &flag)
 
int cancelAll ()
 
void check () const
 
void deleteRequest (int RequestId)
 
void deleteRequests (int size, int *ArrayOfSendRequests)
 
MPI_Aint doubleExtent () const
 
int errorString (int errorcode, char *string, int *resultlen) const
 
MPI_Aint extent (MPI_Datatype datatype) const
 
MPI_Aint intExtent () const
 
int IProbe (int FromSource, int &source, int &MPITag, MPI_Datatype &datatype, int &outcount, int &flag)
 
int IRecv (void *buffer, int count, MPI_Datatype datatype, int source, int &RequestId)
 
int ISend (void *buffer, int count, MPI_Datatype datatype, int target, int &RequestId)
 
int ISendRecv (void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int &SendRequestId, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int &RecvRequestId)
 
bool isTimeMessage (int MPITag) const
 
 MPIAccess (MPIProcessorGroup *ProcessorGroup, int BaseTag=0, int MaxTag=0)
 
bool MPIAsynchronous (int RequestId)
 
bool MPICompleted (int RequestId)
 
MPI_Datatype MPIDatatype (int RequestId)
 
bool MPIIsRecv (int RequestId)
 
int MPIOutCount (int RequestId)
 
int MPITag (int RequestId)
 
int MPITarget (int RequestId)
 
int probe (int FromSource, int &source, int &MPITag, MPI_Datatype &datatype, int &outcount)
 
int recv (void *buffer, int count, MPI_Datatype datatype, int source, int &RequestId, int *OutCount=NULL)
 
int recvMPITag (int sourcerank)
 
int recvRequestIds (int size, int *ArrayOfRecvRequests)
 
int recvRequestIds (int sourcerank, int size, int *ArrayOfRecvRequests)
 
int recvRequestIdsSize ()
 
int recvRequestIdsSize (int sourcerank)
 
int requestFree (MPI_Request *request)
 
int send (void *buffer, int count, MPI_Datatype datatype, int target, int &RequestId)
 
int sendMPITag (int destrank)
 
int sendRecv (void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int &SendRequestId, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int &RecvRequestId, int *OutCount=NULL)
 
int sendRequestIds (int size, int *ArrayOfSendRequests)
 
int sendRequestIds (int destrank, int size, int *ArrayOfSendRequests)
 
int sendRequestIdsSize ()
 
int sendRequestIdsSize (int destrank)
 
int status (int RequestId, int &source, int &tag, int &error, int &outcount, bool keepRequestStruct=false)
 
int test (int RequestId, int &flag)
 
int testAll (int count, int *array_of_RequestIds, int &flag)
 
int testAny (int count, int *array_of_RequestIds, int &RequestId, int &flag)
 
int testSome (int count, int *array_of_RequestIds, int outcounts, int *outarray_of_RequestIds)
 
MPI_Aint timeExtent () const
 
MPI_Datatype timeType () const
 
void trace (bool trace=true)
 
int wait (int RequestId)
 
int waitAll (int count, int *array_of_RequestIds)
 
int waitAny (int count, int *array_of_RequestIds, int &RequestId)
 
int waitSome (int count, int *array_of_RequestIds, int outcount, int *outarray_of_RequestIds)
 
virtual ~MPIAccess ()
 

Detailed Description

!

The class MPIAccess is the gateway to the MPI library. It is a helper class that gathers the calls to the MPI library that are made in the ParaMEDMEM library. This gathering allows easier gathering of information about the communication in the library. With MPIAccess, tags are managed automatically and asynchronous operations are easier.

It is typically called after the MPI_Init() call in a program. It is afterwards passed as a parameter to the constructors of ParaMEDMEM objects so that they access the MPI library via the MPIAccess.

As an example, the following code initializes a processor group made of the zero processor.

#include "MPIAccess.hxx"
#include "ProcessorGroup.hxx"

int main(int argc, char** argv)
{
//initialization
MPI_Init(&argc, &argv);
MEDCoupling::CommInterface comm_interface;

//setting up a processor group with proc 0
set<int> procs;
procs.insert(0);
MEDCoupling::ProcessorGroup group(procs, comm_interface);

MEDCoupling::MPIAccess mpi_access(group);

//cleanup
MPI_Finalize();
}

Constructor & Destructor Documentation

MEDCoupling::MPIAccess::MPIAccess ( MPIProcessorGroup ProcessorGroup,
int  BaseTag = 0,
int  MaxTag = 0 
)

Creates a MPIAccess that is based on the processors included in ProcessorGroup. This class may be called for easier use of MPI API.

Parameters
ProcessorGroupMPIProcessorGroup object giving access to group management
BaseTagand MaxTag define the range of tags to be used. Tags are managed by MPIAccess. They are cyclically incremented. When there is a Send or a Receive operation there is a new RequestId tag returned to the caller. That RequestId may be used to manage the operation Wait, Check of status etc... The MPITag internally managed by MPIAccess is used as "tag" argument in MPI call.

References MEDCoupling::ProcessorGroup::size().

MEDCoupling::MPIAccess::~MPIAccess ( )
virtual

Member Function Documentation

void MEDCoupling::MPIAccess::trace ( bool  trace = true)
void MEDCoupling::MPIAccess::deleteRequest ( int  RequestId)

References requestFree().

Referenced by deleteRequests(), recv(), send(), sendRecv(), and status().

void MEDCoupling::MPIAccess::deleteRequests ( int  size,
int *  ArrayOfSendRequests 
)

References deleteRequest().

int MEDCoupling::MPIAccess::sendMPITag ( int  destrank)
int MEDCoupling::MPIAccess::recvMPITag ( int  sourcerank)
int MEDCoupling::MPIAccess::sendRequestIdsSize ( )
int MEDCoupling::MPIAccess::sendRequestIds ( int  size,
int *  ArrayOfSendRequests 
)
int MEDCoupling::MPIAccess::recvRequestIdsSize ( )
int MEDCoupling::MPIAccess::recvRequestIds ( int  size,
int *  ArrayOfRecvRequests 
)
int MEDCoupling::MPIAccess::sendRequestIdsSize ( int  destrank)
int MEDCoupling::MPIAccess::sendRequestIds ( int  destrank,
int  size,
int *  ArrayOfSendRequests 
)
int MEDCoupling::MPIAccess::recvRequestIdsSize ( int  sourcerank)
int MEDCoupling::MPIAccess::recvRequestIds ( int  sourcerank,
int  size,
int *  ArrayOfRecvRequests 
)
int MEDCoupling::MPIAccess::send ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  target,
int &  RequestId 
)
int MEDCoupling::MPIAccess::ISend ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  target,
int &  RequestId 
)
int MEDCoupling::MPIAccess::recv ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  source,
int &  RequestId,
int *  OutCount = NULL 
)
int MEDCoupling::MPIAccess::IRecv ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  source,
int &  RequestId 
)
int MEDCoupling::MPIAccess::sendRecv ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
int  dest,
int &  SendRequestId,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  source,
int &  RecvRequestId,
int *  OutCount = NULL 
)
int MEDCoupling::MPIAccess::ISendRecv ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
int  dest,
int &  SendRequestId,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  source,
int &  RecvRequestId 
)

References IRecv(), and ISend().

int MEDCoupling::MPIAccess::wait ( int  RequestId)
int MEDCoupling::MPIAccess::test ( int  RequestId,
int &  flag 
)
int MEDCoupling::MPIAccess::waitAny ( int  count,
int *  array_of_RequestIds,
int &  RequestId 
)

References status().

int MEDCoupling::MPIAccess::testAny ( int  count,
int *  array_of_RequestIds,
int &  RequestId,
int &  flag 
)

References status().

int MEDCoupling::MPIAccess::waitAll ( int  count,
int *  array_of_RequestIds 
)

References status(), and wait().

int MEDCoupling::MPIAccess::testAll ( int  count,
int *  array_of_RequestIds,
int &  flag 
)

References status(), and test().

int MEDCoupling::MPIAccess::waitSome ( int  count,
int *  array_of_RequestIds,
int  outcount,
int *  outarray_of_RequestIds 
)

References status().

int MEDCoupling::MPIAccess::testSome ( int  count,
int *  array_of_RequestIds,
int  outcounts,
int *  outarray_of_RequestIds 
)

References status().

int MEDCoupling::MPIAccess::probe ( int  FromSource,
int &  source,
int &  MPITag,
MPI_Datatype &  datatype,
int &  outcount 
)
int MEDCoupling::MPIAccess::IProbe ( int  FromSource,
int &  source,
int &  MPITag,
MPI_Datatype &  datatype,
int &  outcount,
int &  flag 
)
int MEDCoupling::MPIAccess::cancel ( int  RecvRequestId,
int &  flag 
)
int MEDCoupling::MPIAccess::cancel ( int  source,
int  MPITag,
MPI_Datatype  datatype,
int  outcount,
int &  flag 
)
int MEDCoupling::MPIAccess::cancelAll ( )

References cancel(), IProbe(), and MPITag().

int MEDCoupling::MPIAccess::barrier ( )
int MEDCoupling::MPIAccess::errorString ( int  errorcode,
char *  string,
int *  resultlen 
) const
int MEDCoupling::MPIAccess::status ( int  RequestId,
int &  source,
int &  tag,
int &  error,
int &  outcount,
bool  keepRequestStruct = false 
)
int MEDCoupling::MPIAccess::requestFree ( MPI_Request *  request)
void MEDCoupling::MPIAccess::check ( ) const

References MPIDatatype(), and MPITarget().

MPI_Datatype MEDCoupling::MPIAccess::timeType ( ) const

Referenced by cancel().

bool MEDCoupling::MPIAccess::isTimeMessage ( int  MPITag) const
MPI_Aint MEDCoupling::MPIAccess::timeExtent ( ) const

Referenced by extent().

MPI_Aint MEDCoupling::MPIAccess::intExtent ( ) const

Referenced by extent().

MPI_Aint MEDCoupling::MPIAccess::doubleExtent ( ) const

Referenced by extent().

MPI_Aint MEDCoupling::MPIAccess::extent ( MPI_Datatype  datatype) const

References doubleExtent(), intExtent(), and timeExtent().

Referenced by cancel().

int MEDCoupling::MPIAccess::MPITag ( int  RequestId)

Referenced by cancelAll(), status(), test(), and wait().

int MEDCoupling::MPIAccess::MPITarget ( int  RequestId)

Referenced by check(), and status().

bool MEDCoupling::MPIAccess::MPIIsRecv ( int  RequestId)

Referenced by status(), test(), and wait().

bool MEDCoupling::MPIAccess::MPIAsynchronous ( int  RequestId)

Referenced by status().

bool MEDCoupling::MPIAccess::MPICompleted ( int  RequestId)

Referenced by status(), test(), and wait().

MPI_Datatype MEDCoupling::MPIAccess::MPIDatatype ( int  RequestId)

Referenced by check(), recv(), status(), test(), and wait().

int MEDCoupling::MPIAccess::MPIOutCount ( int  RequestId)

Referenced by sendRecv(), status(), test(), and wait().