Public Member Functions | |
int | allGather (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) const |
int | allGatherArrays (MPI_Comm comm, const DataArrayIdType *array, std::unique_ptr< mcIdType[]> &result, std::unique_ptr< mcIdType[]> &resultIndex) const |
void | allGatherArrays (MPI_Comm comm, const DataArrayIdType *array, std::vector< MCAuto< DataArrayIdType > > &arraysOut) const |
template<class T > | |
int | allGatherArraysT (MPI_Comm comm, const typename Traits< T >::ArrayType *array, std::unique_ptr< T[]> &result, std::unique_ptr< mcIdType[]> &resultIndex) const |
template<class T > | |
void | allGatherArraysT2 (MPI_Comm comm, const typename Traits< T >::ArrayType *array, std::vector< MCAuto< typename Traits< T >::ArrayType > > &arraysOut) const |
int | allGatherV (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, MPI_Comm comm) const |
int | allReduce (void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) const |
int | allToAll (void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) const |
void | allToAllArrays (MPI_Comm comm, const std::vector< MCAuto< DataArrayDouble > > &arrays, MCAuto< DataArrayDouble > &arraysOut) const |
void | allToAllArrays (MPI_Comm comm, const std::vector< MCAuto< DataArrayDouble > > &arrays, std::vector< MCAuto< DataArrayDouble > > &arraysOut) const |
void | allToAllArrays (MPI_Comm comm, const std::vector< MCAuto< DataArrayIdType > > &arrays, std::vector< MCAuto< DataArrayIdType > > &arraysOut) const |
template<class T > | |
void | allToAllArraysT (MPI_Comm comm, const std::vector< MCAuto< typename Traits< T >::ArrayType > > &arrays, std::vector< MCAuto< typename Traits< T >::ArrayType > > &arraysOut) const |
template<class T > | |
int | allToAllArraysT2 (MPI_Comm comm, const std::vector< MCAuto< typename Traits< T >::ArrayType > > &arrays, MCAuto< typename Traits< T >::ArrayType > &arrayOut, std::unique_ptr< mcIdType[]> &nbOfElems2, mcIdType &nbOfComponents) const |
int | allToAllV (const void *sendbuf, int *sendcounts, int *senddispls, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *recvdispls, MPI_Datatype recvtype, MPI_Comm comm) const |
int | barrier (MPI_Comm comm) const |
int | broadcast (void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm) const |
int | cancel (MPI_Request *request) const |
int | commCreate (MPI_Comm comm, MPI_Group group, MPI_Comm *comm_output) const |
int | commFree (MPI_Comm *comm) const |
int | commGroup (MPI_Comm comm, MPI_Group *group) const |
CommInterface () | |
int | commRank (MPI_Comm comm, int *rank) const |
int | commSize (MPI_Comm comm, int *size) const |
int | errorString (int errorcode, char *string, int *resultlen) const |
int | gather (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) const |
void | gatherArrays (MPI_Comm comm, int root, const DataArrayIdType *array, std::vector< MCAuto< DataArrayIdType > > &arraysOut) const |
template<class T > | |
int | gatherArraysT (MPI_Comm comm, int root, const typename Traits< T >::ArrayType *array, std::unique_ptr< T[]> &result, std::unique_ptr< mcIdType[]> &resultIndex, int &rank) const |
template<class T > | |
void | gatherArraysT2 (MPI_Comm comm, int root, const typename Traits< T >::ArrayType *array, std::vector< MCAuto< typename Traits< T >::ArrayType > > &arraysOut) const |
int | gatherV (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm comm) const |
int | getCount (MPI_Status *status, MPI_Datatype datatype, int *count) const |
int | groupFree (MPI_Group *group) const |
int | groupIncl (MPI_Group group, int size, int *ranks, MPI_Group *group_output) const |
int | Iprobe (int source, int tag, MPI_Comm comm, int *flag, MPI_Status *status) const |
int | Irecv (void *buffer, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) const |
int | Isend (void *buffer, int count, MPI_Datatype datatype, int target, int tag, MPI_Comm comm, MPI_Request *request) const |
int | probe (int source, int tag, MPI_Comm comm, MPI_Status *status) const |
int | recv (void *buffer, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status) const |
int | reduce (void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) const |
int | requestFree (MPI_Request *request) const |
int | send (void *buffer, int count, MPI_Datatype datatype, int target, int tag, MPI_Comm comm) const |
int | sendRecv (void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag, MPI_Comm comm, MPI_Status *status) |
int | test (MPI_Request *request, int *flag, MPI_Status *status) const |
int | testall (int count, MPI_Request *array_of_requests, int *flag, MPI_Status *array_of_status) const |
int | testany (int count, MPI_Request *array_of_requests, int *index, int *flag, MPI_Status *status) const |
int | testCancelled (MPI_Status *status, int *flag) const |
int | testsome (int incount, MPI_Request *array_of_requests, int *outcount, int *array_of_indices, MPI_Status *array_of_status) const |
int | wait (MPI_Request *request, MPI_Status *status) const |
int | waitall (int count, MPI_Request *array_of_requests, MPI_Status *array_of_status) const |
int | waitany (int count, MPI_Request *array_of_requests, int *index, MPI_Status *status) const |
int | waitsome (int incount, MPI_Request *array_of_requests, int *outcount, int *array_of_indices, MPI_Status *array_of_status) const |
int | worldSize () const |
virtual | ~CommInterface () |
Static Public Member Functions | |
template<class T > | |
static std::unique_ptr< T[]> | ComputeOffset (const std::unique_ptr< T[]> &counts, std::size_t sizeOfCounts) |
template<class T > | |
static std::unique_ptr< T[]> | ComputeOffsetFull (const std::unique_ptr< T[]> &counts, std::size_t sizeOfCounts) |
static std::unique_ptr< mcIdType[]> | SplitArrayOfLength (const std::unique_ptr< mcIdType[]> &counts, std::size_t countsSz, int rk, int size) |
template<class T > | |
static std::unique_ptr< int[]> | ToIntArray (const std::unique_ptr< T[]> &arr, std::size_t size) |
The class CommInterface is the gateway to the MPI library. It is a wrapper around all MPI calls, thus trying to abstract the rest of the code from using the direct MPI API (but this is not strictly respected overall in practice ...). It is used in all the DEC related classes.
It is typically instantiated after the MPI_Init() call in a program and is afterwards passed as a parameter to the constructors of various parallel objects so that they access the MPI library via this common interface.
As an example, the following code excerpt initializes a processor group made of the zero processor.
#include "CommInterface.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); //cleanup MPI_Finalize(); }
MEDCoupling::CommInterface::CommInterface | ( | ) |
|
virtual |
int MEDCoupling::CommInterface::worldSize | ( | ) | const |
int MEDCoupling::CommInterface::commSize | ( | MPI_Comm | comm, |
int * | size | ||
) | const |
int MEDCoupling::CommInterface::commRank | ( | MPI_Comm | comm, |
int * | rank | ||
) | const |
Referenced by gatherArraysT(), and MEDCoupling::MPIProcessorGroup::MPIProcessorGroup().
int MEDCoupling::CommInterface::commGroup | ( | MPI_Comm | comm, |
MPI_Group * | group | ||
) | const |
int MEDCoupling::CommInterface::groupIncl | ( | MPI_Group | group, |
int | size, | ||
int * | ranks, | ||
MPI_Group * | group_output | ||
) | const |
int MEDCoupling::CommInterface::commCreate | ( | MPI_Comm | comm, |
MPI_Group | group, | ||
MPI_Comm * | comm_output | ||
) | const |
int MEDCoupling::CommInterface::groupFree | ( | MPI_Group * | group | ) | const |
int MEDCoupling::CommInterface::commFree | ( | MPI_Comm * | comm | ) | const |
int MEDCoupling::CommInterface::send | ( | void * | buffer, |
int | count, | ||
MPI_Datatype | datatype, | ||
int | target, | ||
int | tag, | ||
MPI_Comm | comm | ||
) | const |
int MEDCoupling::CommInterface::recv | ( | void * | buffer, |
int | count, | ||
MPI_Datatype | datatype, | ||
int | source, | ||
int | tag, | ||
MPI_Comm | comm, | ||
MPI_Status * | status | ||
) | const |
int MEDCoupling::CommInterface::sendRecv | ( | void * | sendbuf, |
int | sendcount, | ||
MPI_Datatype | sendtype, | ||
int | dest, | ||
int | sendtag, | ||
void * | recvbuf, | ||
int | recvcount, | ||
MPI_Datatype | recvtype, | ||
int | source, | ||
int | recvtag, | ||
MPI_Comm | comm, | ||
MPI_Status * | status | ||
) |
int MEDCoupling::CommInterface::Isend | ( | void * | buffer, |
int | count, | ||
MPI_Datatype | datatype, | ||
int | target, | ||
int | tag, | ||
MPI_Comm | comm, | ||
MPI_Request * | request | ||
) | const |
Referenced by MEDCoupling::MPIAccess::ISend().
int MEDCoupling::CommInterface::Irecv | ( | void * | buffer, |
int | count, | ||
MPI_Datatype | datatype, | ||
int | source, | ||
int | tag, | ||
MPI_Comm | comm, | ||
MPI_Request * | request | ||
) | const |
Referenced by MEDCoupling::MPIAccess::cancel(), and MEDCoupling::MPIAccess::IRecv().
int MEDCoupling::CommInterface::wait | ( | MPI_Request * | request, |
MPI_Status * | status | ||
) | const |
Referenced by MEDCoupling::MPIAccess::cancel(), and MEDCoupling::MPIAccess::wait().
int MEDCoupling::CommInterface::test | ( | MPI_Request * | request, |
int * | flag, | ||
MPI_Status * | status | ||
) | const |
Referenced by MEDCoupling::MPIAccess::test().
int MEDCoupling::CommInterface::requestFree | ( | MPI_Request * | request | ) | const |
Referenced by MEDCoupling::MPIAccess::requestFree().
int MEDCoupling::CommInterface::waitany | ( | int | count, |
MPI_Request * | array_of_requests, | ||
int * | index, | ||
MPI_Status * | status | ||
) | const |
int MEDCoupling::CommInterface::testany | ( | int | count, |
MPI_Request * | array_of_requests, | ||
int * | index, | ||
int * | flag, | ||
MPI_Status * | status | ||
) | const |
int MEDCoupling::CommInterface::waitall | ( | int | count, |
MPI_Request * | array_of_requests, | ||
MPI_Status * | array_of_status | ||
) | const |
int MEDCoupling::CommInterface::testall | ( | int | count, |
MPI_Request * | array_of_requests, | ||
int * | flag, | ||
MPI_Status * | array_of_status | ||
) | const |
int MEDCoupling::CommInterface::waitsome | ( | int | incount, |
MPI_Request * | array_of_requests, | ||
int * | outcount, | ||
int * | array_of_indices, | ||
MPI_Status * | array_of_status | ||
) | const |
int MEDCoupling::CommInterface::testsome | ( | int | incount, |
MPI_Request * | array_of_requests, | ||
int * | outcount, | ||
int * | array_of_indices, | ||
MPI_Status * | array_of_status | ||
) | const |
int MEDCoupling::CommInterface::probe | ( | int | source, |
int | tag, | ||
MPI_Comm | comm, | ||
MPI_Status * | status | ||
) | const |
Referenced by MEDCoupling::MPIAccess::probe().
int MEDCoupling::CommInterface::Iprobe | ( | int | source, |
int | tag, | ||
MPI_Comm | comm, | ||
int * | flag, | ||
MPI_Status * | status | ||
) | const |
Referenced by MEDCoupling::MPIAccess::IProbe().
int MEDCoupling::CommInterface::cancel | ( | MPI_Request * | request | ) | const |
Referenced by MEDCoupling::MPIAccess::cancel().
int MEDCoupling::CommInterface::testCancelled | ( | MPI_Status * | status, |
int * | flag | ||
) | const |
Referenced by MEDCoupling::MPIAccess::cancel().
int MEDCoupling::CommInterface::barrier | ( | MPI_Comm | comm | ) | const |
Referenced by MEDCoupling::MPIAccess::barrier().
int MEDCoupling::CommInterface::errorString | ( | int | errorcode, |
char * | string, | ||
int * | resultlen | ||
) | const |
Referenced by MEDCoupling::MPIAccess::errorString().
int MEDCoupling::CommInterface::getCount | ( | MPI_Status * | status, |
MPI_Datatype | datatype, | ||
int * | count | ||
) | const |
int MEDCoupling::CommInterface::broadcast | ( | void * | buffer, |
int | count, | ||
MPI_Datatype | datatype, | ||
int | root, | ||
MPI_Comm | comm | ||
) | const |
Referenced by MEDCoupling::DisjointDEC::renormalizeTargetField().
int MEDCoupling::CommInterface::gather | ( | const void * | sendbuf, |
int | sendcount, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
int | recvcount, | ||
MPI_Datatype | recvtype, | ||
int | root, | ||
MPI_Comm | comm | ||
) | const |
Referenced by gatherArraysT().
int MEDCoupling::CommInterface::gatherV | ( | const void * | sendbuf, |
int | sendcount, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
const int | recvcounts[], | ||
const int | displs[], | ||
MPI_Datatype | recvtype, | ||
int | root, | ||
MPI_Comm | comm | ||
) | const |
Referenced by gatherArraysT().
int MEDCoupling::CommInterface::allGather | ( | void * | sendbuf, |
int | sendcount, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
int | recvcount, | ||
MPI_Datatype | recvtype, | ||
MPI_Comm | comm | ||
) | const |
Referenced by allGatherArraysT(), and MEDCoupling::BlockTopology::BlockTopology().
int MEDCoupling::CommInterface::allGatherV | ( | const void * | sendbuf, |
int | sendcount, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
const int | recvcounts[], | ||
const int | displs[], | ||
MPI_Datatype | recvtype, | ||
MPI_Comm | comm | ||
) | const |
Referenced by allGatherArraysT().
int MEDCoupling::CommInterface::allToAll | ( | void * | sendbuf, |
int | sendcount, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
int | recvcount, | ||
MPI_Datatype | recvtype, | ||
MPI_Comm | comm | ||
) | const |
Referenced by allToAllArraysT2(), and MEDCoupling::ExplicitCoincidentDEC::transferMappingToSource().
int MEDCoupling::CommInterface::allToAllV | ( | const void * | sendbuf, |
int * | sendcounts, | ||
int * | senddispls, | ||
MPI_Datatype | sendtype, | ||
void * | recvbuf, | ||
int * | recvcounts, | ||
int * | recvdispls, | ||
MPI_Datatype | recvtype, | ||
MPI_Comm | comm | ||
) | const |
int MEDCoupling::CommInterface::reduce | ( | void * | sendbuf, |
void * | recvbuf, | ||
int | count, | ||
MPI_Datatype | datatype, | ||
MPI_Op | op, | ||
int | root, | ||
MPI_Comm | comm | ||
) | const |
int MEDCoupling::CommInterface::allReduce | ( | void * | sendbuf, |
void * | recvbuf, | ||
int | count, | ||
MPI_Datatype | datatype, | ||
MPI_Op | op, | ||
MPI_Comm | comm | ||
) | const |
Referenced by MEDCoupling::ParaFIELD::getVolumeIntegral().
void MEDCoupling::CommInterface::gatherArrays | ( | MPI_Comm | comm, |
int | root, | ||
const DataArrayIdType * | array, | ||
std::vector< MCAuto< DataArrayIdType > > & | arraysOut | ||
) | const |
void MEDCoupling::CommInterface::allGatherArrays | ( | MPI_Comm | comm, |
const DataArrayIdType * | array, | ||
std::vector< MCAuto< DataArrayIdType > > & | arraysOut | ||
) | const |
Generalized AllGather collective communication. This method send input array to all procs.
int MEDCoupling::CommInterface::allGatherArrays | ( | MPI_Comm | comm, |
const DataArrayIdType * | array, | ||
std::unique_ptr< mcIdType[]> & | result, | ||
std::unique_ptr< mcIdType[]> & | resultIndex | ||
) | const |
Generalized AllGather collective communication. This method send input array to all procs.
void MEDCoupling::CommInterface::allToAllArrays | ( | MPI_Comm | comm, |
const std::vector< MCAuto< DataArrayIdType > > & | arrays, | ||
std::vector< MCAuto< DataArrayIdType > > & | arraysOut | ||
) | const |
Generalized AllToAll collective communication.
void MEDCoupling::CommInterface::allToAllArrays | ( | MPI_Comm | comm, |
const std::vector< MCAuto< DataArrayDouble > > & | arrays, | ||
std::vector< MCAuto< DataArrayDouble > > & | arraysOut | ||
) | const |
void MEDCoupling::CommInterface::allToAllArrays | ( | MPI_Comm | comm, |
const std::vector< MCAuto< DataArrayDouble > > & | arrays, | ||
MCAuto< DataArrayDouble > & | arraysOut | ||
) | const |
int MEDCoupling::CommInterface::gatherArraysT | ( | MPI_Comm | comm, |
int | root, | ||
const typename Traits< T >::ArrayType * | array, | ||
std::unique_ptr< T[]> & | result, | ||
std::unique_ptr< mcIdType[]> & | resultIndex, | ||
int & | rank | ||
) | const |
References commRank(), commSize(), ComputeOffset(), gather(), and gatherV().
void MEDCoupling::CommInterface::gatherArraysT2 | ( | MPI_Comm | comm, |
int | root, | ||
const typename Traits< T >::ArrayType * | array, | ||
std::vector< MCAuto< typename Traits< T >::ArrayType > > & | arraysOut | ||
) | const |
int MEDCoupling::CommInterface::allGatherArraysT | ( | MPI_Comm | comm, |
const typename Traits< T >::ArrayType * | array, | ||
std::unique_ptr< T[]> & | result, | ||
std::unique_ptr< mcIdType[]> & | resultIndex | ||
) | const |
References allGather(), allGatherV(), commSize(), and ComputeOffset().
void MEDCoupling::CommInterface::allGatherArraysT2 | ( | MPI_Comm | comm, |
const typename Traits< T >::ArrayType * | array, | ||
std::vector< MCAuto< typename Traits< T >::ArrayType > > & | arraysOut | ||
) | const |
int MEDCoupling::CommInterface::allToAllArraysT2 | ( | MPI_Comm | comm, |
const std::vector< MCAuto< typename Traits< T >::ArrayType > > & | arrays, | ||
MCAuto< typename Traits< T >::ArrayType > & | arrayOut, | ||
std::unique_ptr< mcIdType[]> & | nbOfElems2, | ||
mcIdType & | nbOfComponents | ||
) | const |
References allToAll(), allToAllV(), commSize(), and ComputeOffset().
void MEDCoupling::CommInterface::allToAllArraysT | ( | MPI_Comm | comm, |
const std::vector< MCAuto< typename Traits< T >::ArrayType > > & | arrays, | ||
std::vector< MCAuto< typename Traits< T >::ArrayType > > & | arraysOut | ||
) | const |
References ComputeOffset().
|
static |
counts is expected to be an array of array length. This method returns an array of split array.
References MEDCoupling::DataArray::GetSlice().
|
static |
Helper of alltoallv and allgatherv
|
static |
Helper of alltoallv and allgatherv
Referenced by allGatherArraysT(), allToAllArraysT(), allToAllArraysT2(), and gatherArraysT().
|
static |
Helper of alltoallv and allgatherv