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 () |
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(); }
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.
ProcessorGroup | MPIProcessorGroup object giving access to group management |
BaseTag | and 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().
|
virtual |
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 | ||
) |
References MEDCoupling::_message_time, deleteRequest(), MEDCoupling::CommInterface::send(), and MEDCoupling::TimeMessage::tag.
Referenced by sendRecv().
int MEDCoupling::MPIAccess::ISend | ( | void * | buffer, |
int | count, | ||
MPI_Datatype | datatype, | ||
int | target, | ||
int & | RequestId | ||
) |
References MEDCoupling::_message_time, MEDCoupling::CommInterface::Isend(), and MEDCoupling::TimeMessage::tag.
Referenced by ISendRecv().
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 | ||
) |
References MEDCoupling::CommInterface::Irecv().
Referenced by ISendRecv(), and sendRecv().
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 |
||
) |
References deleteRequest(), IRecv(), MPIOutCount(), send(), and wait().
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 | ||
) |
int MEDCoupling::MPIAccess::wait | ( | int | RequestId | ) |
References MEDCoupling::CommInterface::getCount(), MPICompleted(), MPIDatatype(), MPIIsRecv(), MPIOutCount(), MPITag(), status(), and MEDCoupling::CommInterface::wait().
Referenced by sendRecv(), and waitAll().
int MEDCoupling::MPIAccess::test | ( | int | RequestId, |
int & | flag | ||
) |
References MEDCoupling::CommInterface::getCount(), MPICompleted(), MPIDatatype(), MPIIsRecv(), MPIOutCount(), MPITag(), status(), and MEDCoupling::CommInterface::test().
Referenced by testAll().
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 | ||
) |
int MEDCoupling::MPIAccess::testAll | ( | int | count, |
int * | array_of_RequestIds, | ||
int & | flag | ||
) |
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 | ||
) |
References MEDCoupling::CommInterface::getCount(), and MEDCoupling::CommInterface::Iprobe().
Referenced by cancelAll().
int MEDCoupling::MPIAccess::cancel | ( | int | RecvRequestId, |
int & | flag | ||
) |
References MEDCoupling::CommInterface::cancel(), MEDCoupling::CommInterface::testCancelled(), and MEDCoupling::CommInterface::wait().
Referenced by cancelAll().
int MEDCoupling::MPIAccess::cancel | ( | int | source, |
int | MPITag, | ||
MPI_Datatype | datatype, | ||
int | outcount, | ||
int & | flag | ||
) |
int MEDCoupling::MPIAccess::barrier | ( | ) |
References MEDCoupling::CommInterface::barrier(), and status().
int MEDCoupling::MPIAccess::errorString | ( | int | errorcode, |
char * | string, | ||
int * | resultlen | ||
) | const |
References MEDCoupling::CommInterface::errorString().
int MEDCoupling::MPIAccess::status | ( | int | RequestId, |
int & | source, | ||
int & | tag, | ||
int & | error, | ||
int & | outcount, | ||
bool | keepRequestStruct = false |
||
) |
References deleteRequest(), MEDCoupling::CommInterface::getCount(), MPIAsynchronous(), MPICompleted(), MPIDatatype(), MPIIsRecv(), MPIOutCount(), MPITag(), and MPITarget().
Referenced by barrier(), test(), testAll(), testAny(), testSome(), wait(), waitAll(), waitAny(), and waitSome().
int MEDCoupling::MPIAccess::requestFree | ( | MPI_Request * | request | ) |
References MEDCoupling::CommInterface::requestFree().
Referenced by deleteRequest().
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 |
References MEDCoupling::_message_time.
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().
bool MEDCoupling::MPIAccess::MPIAsynchronous | ( | int | RequestId | ) |
Referenced by status().
bool MEDCoupling::MPIAccess::MPICompleted | ( | int | RequestId | ) |
MPI_Datatype MEDCoupling::MPIAccess::MPIDatatype | ( | int | RequestId | ) |
int MEDCoupling::MPIAccess::MPIOutCount | ( | int | RequestId | ) |
Referenced by sendRecv(), status(), test(), and wait().