OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::singleton::MpiManager Class Reference

Wrapper functions that simplify the use of MPI. More...

#include <mpiManager.h>

+ Collaboration diagram for olb::singleton::MpiManager:

Public Member Functions

void init (int *argc, char ***argv, bool verbose=true)
 Initializes the mpi manager.
 
int getSize () const
 Returns the number of processes.
 
int getRank () const
 Returns the process ID.
 
int bossId () const
 Returns process ID of main processor.
 
bool isMainProcessor () const
 Tells whether current processor is main processor.
 
double getTime () const
 Returns universal MPI-time in seconds.
 
void barrier (MPI_Comm comm=MPI_COMM_WORLD)
 Synchronizes the processes.
 
void synchronizeIO (unsigned tDelay=100, MPI_Comm comm=MPI_COMM_WORLD)
 Synchronizes the processes and wait to ensure correct cout order.
 
template<typename T >
void send (T *buf, int count, int dest, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Sends data at *buf, blocking.
 
template<typename T , unsigned DIM>
void send (util::ADf< T, DIM > *buf, int count, int dest, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename... args>
void send (std::vector< args... > &vec, int dest, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<class T , std::size_t N>
void send (std::array< T, N > &array, int dest, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void sendInit (T *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Initialize persistent non-blocking send.
 
template<typename T , unsigned DIM>
void sendInit (util::ADf< T, DIM > *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void iSend (T *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Sends data at *buf, non blocking.
 
template<typename T , unsigned DIM>
void iSend (util::ADf< T, DIM > *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void ibSend (T *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Sends data at *buf, non blocking and buffered.
 
template<typename T , unsigned DIM>
void ibSend (util::ADf< T, DIM > *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
std::size_t probeReceiveSize (int source, MPI_Datatype type, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Probe size of incoming message.
 
template<typename TYPE >
std::size_t probeReceiveSize (int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Probe size of incoming message with TYPE.
 
template<typename T >
void receive (T *buf, int count, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Receives data at *buf, blocking.
 
template<typename T , unsigned DIM>
void receive (util::ADf< T, DIM > *buf, int count, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename... args>
void receive (std::vector< args... > &vec, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<class T , std::size_t N>
void receive (std::array< T, N > &array, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void recvInit (T *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Initialize persistent non-blocking receive.
 
template<typename T , unsigned DIM>
void recvInit (util::ADf< T, DIM > *buf, int count, int dest, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void iRecv (T *buf, int count, int source, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Receives data at *buf, non blocking.
 
template<typename T , unsigned DIM>
void iRecv (util::ADf< T, DIM > *buf, int count, int source, MPI_Request *request, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void sendRecv (T *sendBuf, T *recvBuf, int count, int dest, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 Send and receive data between two partners.
 
template<typename T , unsigned DIM>
void sendRecv (util::ADf< T, DIM > *sendBuf, util::ADf< T, DIM > *recvBuf, int count, int dest, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void sendToMaster (T *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm=MPI_COMM_WORLD)
 Sends data to master processor.
 
template<typename T >
void scatterv (T *sendBuf, int *sendCounts, int *displs, T *recvBuf, int recvCount, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Scatter data from one processor over multiple processors.
 
template<typename T >
void gather (T *sendBuf, int sendCount, T *recvBuf, int recvCount, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Gather data from multiple processors to one processor.
 
template<typename T >
void allGather (T *sendBuf, int sendCount, T *recvBuf, int recvCount, MPI_Comm comm=MPI_COMM_WORLD)
 Gather data from multiple processors to every processor.
 
template<typename T >
void gatherv (T *sendBuf, int sendCount, T *recvBuf, int *recvCounts, int *displs, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Gather data from multiple processors to one processor.
 
template<typename T >
void allGatherv (T *sendBuf, int sendCount, T *recvBuf, int *recvCounts, int *displs, MPI_Comm comm=MPI_COMM_WORLD)
 Gather data from multiple processors to every processor.
 
template<typename T >
void bCast (T *sendBuf, int sendCount, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Broadcast data from one processor to multiple processors.
 
template<typename T , unsigned DIM>
void bCast (util::ADf< T, DIM > *sendBuf, int sendCount, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T , unsigned DIM>
void bCast (BlockData< 2, util::ADf< T, DIM >, util::ADf< T, DIM > > &sendData, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void bCast (T &sendVal, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T , unsigned DIM>
void bCast (Vector< T, DIM > &sendData, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void bCastThroughMaster (T *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm=MPI_COMM_WORLD)
 Broadcast data when root is unknown to other processors.
 
template<typename T , unsigned DIM>
void bCastThroughMaster (util::ADf< T, DIM > *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm=MPI_COMM_WORLD)
 
void bCast (std::string &message, int root=0)
 Special case for broadcasting strings. Memory handling is automatic.
 
void bCast (BlockData< 2, double, double > &sendData, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Special case for broadcasting BlockData2D.
 
void bCast (BlockData< 2, float, float > &sendData, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Special case for broadcasting BlockData2D.
 
template<typename T >
void reduce (T &sendVal, T &recvVal, MPI_Op op, int root=0, MPI_Comm=MPI_COMM_WORLD)
 Reduction operation toward one processor.
 
template<typename T >
void reduce (T *sendVal, T *recvVal, int count, MPI_Op op, int root=0, MPI_Comm=MPI_COMM_WORLD)
 
template<typename T , unsigned DIM>
void reduce (util::ADf< T, DIM > &sendVal, util::ADf< T, DIM > &recvVal, MPI_Op op, int root=0, MPI_Comm=MPI_COMM_WORLD)
 
template<typename T , unsigned DIM>
void reduce (BlockData< 2, util::ADf< T, DIM >, util::ADf< T, DIM > > &sendVal, BlockData< 2, util::ADf< T, DIM >, util::ADf< T, DIM > > &recvVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void reduceVect (std::vector< T > &sendVal, std::vector< T > &recvVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Element-per-element reduction of a vector of data.
 
template<typename T >
void reduceAndBcast (T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 Reduction operation, followed by a broadcast.
 
template<typename T , unsigned DIM>
void reduceAndBcast (util::ADf< T, DIM > &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void allreduce (const T *in, T *out, int count, MPI_Op op, MPI_Comm comm=MPI_COMM_WORLD)
 
template<typename T >
void allReduce (T &reductVal, MPI_Op op, MPI_Comm comm=MPI_COMM_WORLD)
 All reduction operation of a vector data.
 
template<typename T >
void allReduceVect (std::vector< T > &reductVal, MPI_Op op, MPI_Comm comm=MPI_COMM_WORLD)
 Element-per-element all-reduction of a vector of data (in-place)
 
void wait (MPI_Request *request, MPI_Status *status)
 Complete a non-blocking MPI operation.
 
void waitAll (MpiNonBlockingHelper &mpiNbHelper)
 Complete a series of non-blocking MPI operations.
 
template<>
void send (bool *buf, int count, int dest, int tag, MPI_Comm comm)
 
template<>
void send (char *buf, int count, int dest, int tag, MPI_Comm comm)
 
template<>
void send (int *buf, int count, int dest, int tag, MPI_Comm comm)
 
template<>
void send (float *buf, int count, int dest, int tag, MPI_Comm comm)
 
template<>
void send (double *buf, int count, int dest, int tag, MPI_Comm comm)
 
template<>
void sendInit (double *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void sendInit (int *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void sendInit (bool *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iSend (bool *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iSend (char *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iSend (int *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iSend (float *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iSend (double *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iSend (long double *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void ibSend (bool *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void ibSend (char *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void ibSend (int *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void ibSend (float *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void ibSend (double *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void receive (bool *buf, int count, int source, int tag, MPI_Comm comm)
 
template<>
void receive (char *buf, int count, int source, int tag, MPI_Comm comm)
 
template<>
void receive (int *buf, int count, int source, int tag, MPI_Comm comm)
 
template<>
void receive (float *buf, int count, int source, int tag, MPI_Comm comm)
 
template<>
void receive (double *buf, int count, int source, int tag, MPI_Comm comm)
 
template<>
void receive (long double *buf, int count, int source, int tag, MPI_Comm comm)
 
template<>
void sendToMaster (bool *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void sendToMaster (char *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void sendToMaster (int *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void sendToMaster (float *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void sendToMaster (double *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void recvInit (double *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void recvInit (int *buf, int count, int dest, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iRecv (bool *buf, int count, int source, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iRecv (char *buf, int count, int source, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iRecv (int *buf, int count, int source, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iRecv (float *buf, int count, int source, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void iRecv (double *buf, int count, int source, MPI_Request *request, int tag, MPI_Comm comm)
 
template<>
void sendRecv (bool *sendBuf, bool *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void sendRecv (char *sendBuf, char *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void sendRecv (int *sendBuf, int *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void sendRecv (float *sendBuf, float *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void sendRecv (long *sendBuf, long *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void sendRecv (double *sendBuf, double *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void sendRecv (long double *sendBuf, long double *recvBuf, int count, int dest, int source, int tag, MPI_Comm comm)
 
template<>
void scatterv (bool *sendBuf, int *sendCounts, int *displs, bool *recvBuf, int recvCount, int root, MPI_Comm comm)
 
template<>
void scatterv (char *sendBuf, int *sendCounts, int *displs, char *recvBuf, int recvCount, int root, MPI_Comm comm)
 
template<>
void scatterv (int *sendBuf, int *sendCounts, int *displs, int *recvBuf, int recvCount, int root, MPI_Comm comm)
 
template<>
void scatterv (float *sendBuf, int *sendCounts, int *displs, float *recvBuf, int recvCount, int root, MPI_Comm comm)
 
template<>
void scatterv (double *sendBuf, int *sendCounts, int *displs, double *recvBuf, int recvCount, int root, MPI_Comm comm)
 
template<>
void gather (int *sendBuf, int sendCount, int *recvBuf, int recvCount, int root, MPI_Comm comm)
 
template<>
void allGather (bool *sendBuf, int sendCount, bool *recvBuf, int recvCount, MPI_Comm comm)
 
template<>
void allGather (char *sendBuf, int sendCount, char *recvBuf, int recvCount, MPI_Comm comm)
 
template<>
void allGather (int *sendBuf, int sendCount, int *recvBuf, int recvCount, MPI_Comm comm)
 
template<>
void allGather (float *sendBuf, int sendCount, float *recvBuf, int recvCount, MPI_Comm comm)
 
template<>
void allGather (double *sendBuf, int sendCount, double *recvBuf, int recvCount, MPI_Comm comm)
 
template<>
void gatherv (bool *sendBuf, int sendCount, bool *recvBuf, int *recvCounts, int *displs, int root, MPI_Comm comm)
 
template<>
void gatherv (char *sendBuf, int sendCount, char *recvBuf, int *recvCounts, int *displs, int root, MPI_Comm comm)
 
template<>
void gatherv (int *sendBuf, int sendCount, int *recvBuf, int *recvCounts, int *displs, int root, MPI_Comm comm)
 
template<>
void gatherv (float *sendBuf, int sendCount, float *recvBuf, int *recvCounts, int *displs, int root, MPI_Comm comm)
 
template<>
void gatherv (double *sendBuf, int sendCount, double *recvBuf, int *recvCounts, int *displs, int root, MPI_Comm comm)
 
template<>
void allGatherv (bool *sendBuf, int sendCount, bool *recvBuf, int *recvCounts, int *displs, MPI_Comm comm)
 
template<>
void allGatherv (char *sendBuf, int sendCount, char *recvBuf, int *recvCounts, int *displs, MPI_Comm comm)
 
template<>
void allGatherv (int *sendBuf, int sendCount, int *recvBuf, int *recvCounts, int *displs, MPI_Comm comm)
 
template<>
void allGatherv (float *sendBuf, int sendCount, float *recvBuf, int *recvCounts, int *displs, MPI_Comm comm)
 
template<>
void allGatherv (double *sendBuf, int sendCount, double *recvBuf, int *recvCounts, int *displs, MPI_Comm comm)
 
template<>
void bCast (bool *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (char *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (unsigned char *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (int *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (unsigned long *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (float *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (double *sendBuf, int sendCount, int root, MPI_Comm comm)
 
template<>
void bCast (bool &sendVal, int root, MPI_Comm comm)
 
template<>
void bCast (char &sendVal, int root, MPI_Comm comm)
 
template<>
void bCast (unsigned char &sendVal, int root, MPI_Comm comm)
 
template<>
void bCast (int &sendVal, int root, MPI_Comm comm)
 
template<>
void bCast (unsigned long &sendVal, int root, MPI_Comm comm)
 
template<>
void bCast (float &sendVal, int root, MPI_Comm comm)
 
template<>
void bCast (double &sendVal, int root, MPI_Comm comm)
 
template<>
void bCastThroughMaster (bool *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void bCastThroughMaster (char *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void bCastThroughMaster (int *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void bCastThroughMaster (float *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void bCastThroughMaster (double *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm)
 
template<>
void reduce (bool &sendVal, bool &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (char &sendVal, char &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (int &sendVal, int &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (float &sendVal, float &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (float *sendVal, float *recvVal, int count, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (double &sendVal, double &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceVect (std::vector< char > &sendVal, std::vector< char > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceVect (std::vector< int > &sendVal, std::vector< int > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceVect (std::vector< float > &sendVal, std::vector< float > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceVect (std::vector< double > &sendVal, std::vector< double > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (bool &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (char &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (int &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (float &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (double &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (long double &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (long &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduceAndBcast (unsigned long &reductVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void allreduce (const float *in, float *out, int count, MPI_Op op, MPI_Comm comm)
 
template<>
void allreduce (const double *in, double *out, int count, MPI_Op op, MPI_Comm comm)
 
template<>
void allreduce (const unsigned *in, unsigned *out, int count, MPI_Op op, MPI_Comm comm)
 
template<>
void allreduce (const int *in, int *out, int count, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduce (bool &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduce (char &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduce (int &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduce (float &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduce (double &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduce (long double &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduceVect (std::vector< char > &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduceVect (std::vector< int > &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduceVect (std::vector< float > &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduceVect (std::vector< double > &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void allReduceVect (std::vector< long double > &reductVal, MPI_Op op, MPI_Comm comm)
 
template<>
void reduce (BlockData< 2, double, int > &sendVal, BlockData< 2, double, int > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (BlockData< 2, double, double > &sendVal, BlockData< 2, double, double > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 
template<>
void reduce (BlockData< 2, float, float > &sendVal, BlockData< 2, float, float > &recvVal, MPI_Op op, int root, MPI_Comm comm)
 

Friends

MpiManager & mpi ()
 

Detailed Description

Wrapper functions that simplify the use of MPI.

Definition at line 90 of file mpiManager.h.

Member Function Documentation

◆ allGather() [1/6]

template<>
void olb::singleton::MpiManager::allGather ( bool * sendBuf,
int sendCount,
bool * recvBuf,
int recvCount,
MPI_Comm comm )

Definition at line 779 of file mpiManager.cpp.

782{
783 if (!ok) {
784 return;
785 }
786 MPI_Allgather(static_cast<void*>(sendBuf), sendCount, MPI_BYTE,
787 static_cast<void*>(recvBuf), recvCount, MPI_BYTE,
788 comm);
789}

◆ allGather() [2/6]

template<>
void olb::singleton::MpiManager::allGather ( char * sendBuf,
int sendCount,
char * recvBuf,
int recvCount,
MPI_Comm comm )

Definition at line 792 of file mpiManager.cpp.

795{
796 if (!ok) {
797 return;
798 }
799 MPI_Allgather(static_cast<void*>(sendBuf), sendCount, MPI_CHAR,
800 static_cast<void*>(recvBuf), recvCount, MPI_CHAR,
801 comm);
802}

◆ allGather() [3/6]

template<>
void olb::singleton::MpiManager::allGather ( double * sendBuf,
int sendCount,
double * recvBuf,
int recvCount,
MPI_Comm comm )

Definition at line 831 of file mpiManager.cpp.

834{
835 if (!ok) {
836 return;
837 }
838 MPI_Allgather(static_cast<void*>(sendBuf), sendCount, MPI_DOUBLE,
839 static_cast<void*>(recvBuf), recvCount, MPI_DOUBLE,
840 comm);
841}

◆ allGather() [4/6]

template<>
void olb::singleton::MpiManager::allGather ( float * sendBuf,
int sendCount,
float * recvBuf,
int recvCount,
MPI_Comm comm )

Definition at line 818 of file mpiManager.cpp.

821{
822 if (!ok) {
823 return;
824 }
825 MPI_Allgather(static_cast<void*>(sendBuf), sendCount, MPI_FLOAT,
826 static_cast<void*>(recvBuf), recvCount, MPI_FLOAT,
827 comm);
828}

◆ allGather() [5/6]

template<>
void olb::singleton::MpiManager::allGather ( int * sendBuf,
int sendCount,
int * recvBuf,
int recvCount,
MPI_Comm comm )

Definition at line 805 of file mpiManager.cpp.

808{
809 if (!ok) {
810 return;
811 }
812 MPI_Allgather(static_cast<void*>(sendBuf), sendCount, MPI_INT,
813 static_cast<void*>(recvBuf), recvCount, MPI_INT,
814 comm);
815}

◆ allGather() [6/6]

template<typename T >
void olb::singleton::MpiManager::allGather ( T * sendBuf,
int sendCount,
T * recvBuf,
int recvCount,
MPI_Comm comm = MPI_COMM_WORLD )

Gather data from multiple processors to every processor.

◆ allGatherv() [1/6]

template<>
void olb::singleton::MpiManager::allGatherv ( bool * sendBuf,
int sendCount,
bool * recvBuf,
int * recvCounts,
int * displs,
MPI_Comm comm )

Definition at line 963 of file mpiManager.cpp.

966{
967 if (!ok) {
968 return;
969 }
970 MPI_Allgatherv(static_cast<void*>(sendBuf), sendCount, MPI_BYTE,
971 static_cast<void*>(recvBuf), recvCounts, displs,
972 MPI_BYTE, comm);
973}

◆ allGatherv() [2/6]

template<>
void olb::singleton::MpiManager::allGatherv ( char * sendBuf,
int sendCount,
char * recvBuf,
int * recvCounts,
int * displs,
MPI_Comm comm )

Definition at line 976 of file mpiManager.cpp.

979{
980 if (!ok) {
981 return;
982 }
983 MPI_Allgatherv(static_cast<void*>(sendBuf), sendCount, MPI_CHAR,
984 static_cast<void*>(recvBuf), recvCounts, displs,
985 MPI_CHAR, comm);
986}

◆ allGatherv() [3/6]

template<>
void olb::singleton::MpiManager::allGatherv ( double * sendBuf,
int sendCount,
double * recvBuf,
int * recvCounts,
int * displs,
MPI_Comm comm )

Definition at line 1015 of file mpiManager.cpp.

1018{
1019 if (!ok) {
1020 return;
1021 }
1022 MPI_Allgatherv(static_cast<void*>(sendBuf), sendCount, MPI_DOUBLE,
1023 static_cast<void*>(recvBuf), recvCounts, displs,
1024 MPI_DOUBLE, comm);
1025}

◆ allGatherv() [4/6]

template<>
void olb::singleton::MpiManager::allGatherv ( float * sendBuf,
int sendCount,
float * recvBuf,
int * recvCounts,
int * displs,
MPI_Comm comm )

Definition at line 1002 of file mpiManager.cpp.

1005{
1006 if (!ok) {
1007 return;
1008 }
1009 MPI_Allgatherv(static_cast<void*>(sendBuf), sendCount, MPI_FLOAT,
1010 static_cast<void*>(recvBuf), recvCounts, displs,
1011 MPI_FLOAT, comm);
1012}

◆ allGatherv() [5/6]

template<>
void olb::singleton::MpiManager::allGatherv ( int * sendBuf,
int sendCount,
int * recvBuf,
int * recvCounts,
int * displs,
MPI_Comm comm )

Definition at line 989 of file mpiManager.cpp.

992{
993 if (!ok) {
994 return;
995 }
996 MPI_Allgatherv(static_cast<void*>(sendBuf), sendCount, MPI_INT,
997 static_cast<void*>(recvBuf), recvCounts, displs,
998 MPI_INT, comm);
999}

◆ allGatherv() [6/6]

template<typename T >
void olb::singleton::MpiManager::allGatherv ( T * sendBuf,
int sendCount,
T * recvBuf,
int * recvCounts,
int * displs,
MPI_Comm comm = MPI_COMM_WORLD )

Gather data from multiple processors to every processor.

◆ allReduce() [1/7]

template<>
void olb::singleton::MpiManager::allReduce ( bool & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1552 of file mpiManager.cpp.

1553{
1554 if (!ok) {
1555 return;
1556 }
1557 bool recvVal;
1558 MPI_Allreduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_BYTE, op, comm);
1559 reductVal = recvVal;
1560}

◆ allReduce() [2/7]

template<>
void olb::singleton::MpiManager::allReduce ( char & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1563 of file mpiManager.cpp.

1564{
1565 if (!ok) {
1566 return;
1567 }
1568 char recvVal;
1569 MPI_Allreduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_CHAR, op, comm);
1570 reductVal = recvVal;
1571}

◆ allReduce() [3/7]

template<>
void olb::singleton::MpiManager::allReduce ( double & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1596 of file mpiManager.cpp.

1597{
1598 if (!ok) {
1599 return;
1600 }
1601 double recvVal;
1602 MPI_Allreduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_DOUBLE, op, comm);
1603 reductVal = recvVal;
1604}

◆ allReduce() [4/7]

template<>
void olb::singleton::MpiManager::allReduce ( float & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1585 of file mpiManager.cpp.

1586{
1587 if (!ok) {
1588 return;
1589 }
1590 float recvVal;
1591 MPI_Allreduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_FLOAT, op, comm);
1592 reductVal = recvVal;
1593}

◆ allReduce() [5/7]

template<>
void olb::singleton::MpiManager::allReduce ( int & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1574 of file mpiManager.cpp.

1575{
1576 if (!ok) {
1577 return;
1578 }
1579 int recvVal;
1580 MPI_Allreduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_INT, op, comm);
1581 reductVal = recvVal;
1582}

◆ allReduce() [6/7]

template<>
void olb::singleton::MpiManager::allReduce ( long double & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1607 of file mpiManager.cpp.

1608{
1609 if (!ok) {
1610 return;
1611 }
1612 long double recvVal;
1613 MPI_Allreduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_LONG_DOUBLE, op, comm);
1614 reductVal = recvVal;
1615}

◆ allReduce() [7/7]

template<typename T >
void olb::singleton::MpiManager::allReduce ( T & reductVal,
MPI_Op op,
MPI_Comm comm = MPI_COMM_WORLD )

All reduction operation of a vector data.

◆ allreduce() [1/5]

template<>
void olb::singleton::MpiManager::allreduce ( const double * in,
double * out,
int count,
MPI_Op op,
MPI_Comm comm )

Definition at line 1525 of file mpiManager.cpp.

1526{
1527 if (!ok) {
1528 return;
1529 }
1530 MPI_Allreduce(in, out, count, MPI_DOUBLE, op, comm);
1531}

◆ allreduce() [2/5]

template<>
void olb::singleton::MpiManager::allreduce ( const float * in,
float * out,
int count,
MPI_Op op,
MPI_Comm comm )

Definition at line 1516 of file mpiManager.cpp.

1517{
1518 if (!ok) {
1519 return;
1520 }
1521 MPI_Allreduce(in, out, count, MPI_FLOAT, op, comm);
1522}

◆ allreduce() [3/5]

template<>
void olb::singleton::MpiManager::allreduce ( const int * in,
int * out,
int count,
MPI_Op op,
MPI_Comm comm )

Definition at line 1543 of file mpiManager.cpp.

1544{
1545 if (!ok) {
1546 return;
1547 }
1548 MPI_Allreduce(in, out, count, MPI_INT, op, comm);
1549}

◆ allreduce() [4/5]

template<typename T >
void olb::singleton::MpiManager::allreduce ( const T * in,
T * out,
int count,
MPI_Op op,
MPI_Comm comm = MPI_COMM_WORLD )
+ Here is the caller graph for this function:

◆ allreduce() [5/5]

template<>
void olb::singleton::MpiManager::allreduce ( const unsigned * in,
unsigned * out,
int count,
MPI_Op op,
MPI_Comm comm )

Definition at line 1534 of file mpiManager.cpp.

1535{
1536 if (!ok) {
1537 return;
1538 }
1539 MPI_Allreduce(in, out, count, MPI_UNSIGNED, op, comm);
1540}

◆ allReduceVect() [1/6]

template<>
void olb::singleton::MpiManager::allReduceVect ( std::vector< char > & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1653 of file mpiManager.cpp.

1654{
1655 if (!ok) {
1656 return;
1657 }
1658 MPI_Allreduce(MPI_IN_PLACE, static_cast<void*>(reductVal.data()), static_cast<int>(reductVal.size()), MPI_CHAR, op, comm);
1659}

◆ allReduceVect() [2/6]

template<>
void olb::singleton::MpiManager::allReduceVect ( std::vector< double > & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1680 of file mpiManager.cpp.

1681{
1682 if (!ok) {
1683 return;
1684 }
1685 MPI_Allreduce(MPI_IN_PLACE, static_cast<void*>(reductVal.data()), static_cast<int>(reductVal.size()), MPI_DOUBLE, op, comm);
1686}

◆ allReduceVect() [3/6]

template<>
void olb::singleton::MpiManager::allReduceVect ( std::vector< float > & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1671 of file mpiManager.cpp.

1672{
1673 if (!ok) {
1674 return;
1675 }
1676 MPI_Allreduce(MPI_IN_PLACE, static_cast<void*>(reductVal.data()), static_cast<int>(reductVal.size()), MPI_FLOAT, op, comm);
1677}

◆ allReduceVect() [4/6]

template<>
void olb::singleton::MpiManager::allReduceVect ( std::vector< int > & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1662 of file mpiManager.cpp.

1663{
1664 if (!ok) {
1665 return;
1666 }
1667 MPI_Allreduce(MPI_IN_PLACE, static_cast<void*>(reductVal.data()), static_cast<int>(reductVal.size()), MPI_INT, op, comm);
1668}

◆ allReduceVect() [5/6]

template<>
void olb::singleton::MpiManager::allReduceVect ( std::vector< long double > & reductVal,
MPI_Op op,
MPI_Comm comm )

Definition at line 1689 of file mpiManager.cpp.

1690{
1691 if (!ok) {
1692 return;
1693 }
1694 MPI_Allreduce(MPI_IN_PLACE, static_cast<void*>(reductVal.data()), static_cast<int>(reductVal.size()), MPI_LONG_DOUBLE, op, comm);
1695}

◆ allReduceVect() [6/6]

template<typename T >
void olb::singleton::MpiManager::allReduceVect ( std::vector< T > & reductVal,
MPI_Op op,
MPI_Comm comm = MPI_COMM_WORLD )

Element-per-element all-reduction of a vector of data (in-place)

◆ barrier()

void olb::singleton::MpiManager::barrier ( MPI_Comm comm = MPI_COMM_WORLD)

Synchronizes the processes.

Definition at line 93 of file mpiManager.cpp.

94{
95 if (!ok) {
96 return;
97 }
98 MPI_Barrier(comm);
99}
+ Here is the caller graph for this function:

◆ bCast() [1/22]

void olb::singleton::MpiManager::bCast ( BlockData< 2, double, double > & sendData,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Special case for broadcasting BlockData2D.

Definition at line 152 of file blockData.hh.

153{
154 if (!ok) {
155 return;
156 }
157 for (unsigned iD=0; iD < sendData.getSize(); ++iD) {
158 MPI_Bcast(static_cast<void*>(sendData.getColumn(iD).data()),
159 sendData.getNcells(), MPI_DOUBLE, root, comm);
160 }
161}

References olb::BlockData< D, T, U >::getColumn(), olb::BlockStructureD< D >::getNcells(), and olb::BlockData< D, T, U >::getSize().

+ Here is the call graph for this function:

◆ bCast() [2/22]

void olb::singleton::MpiManager::bCast ( BlockData< 2, float, float > & sendData,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Special case for broadcasting BlockData2D.

Definition at line 163 of file blockData.hh.

164{
165 if (!ok) {
166 return;
167 }
168 for (unsigned iD=0; iD < sendData.getSize(); ++iD) {
169 MPI_Bcast(static_cast<void*>(sendData.getColumn(iD).data()),
170 sendData.getNcells(), MPI_FLOAT, root, comm);
171 }
172}

References olb::BlockData< D, T, U >::getColumn(), olb::BlockStructureD< D >::getNcells(), and olb::BlockData< D, T, U >::getSize().

+ Here is the call graph for this function:

◆ bCast() [3/22]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::bCast ( BlockData< 2, util::ADf< T, DIM >, util::ADf< T, DIM > > & sendData,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 134 of file mpiManagerAD.hh.

137{
138 if (!ok) {
139 return;
140 }
141// MPI_Bcast(static_cast<void*>(sendData.getRawData()),
142// sendData.getDataSize(), MPI_DOUBLE, root, comm);
143 for (unsigned iD=0; iD < sendData.getSize(); ++iD) {
144 MPI_Bcast(static_cast<void*>(sendData.getColumn(iD).data()),
145 sendData.getNcells(), MPI_DOUBLE, root, comm);
146 }
147}

◆ bCast() [4/22]

template<>
void olb::singleton::MpiManager::bCast ( bool & sendVal,
int root,
MPI_Comm comm )

Definition at line 1159 of file mpiManager.cpp.

1160{
1161 if (!ok) {
1162 return;
1163 }
1164 MPI_Bcast(&sendVal, 1, MPI_BYTE, root, comm);
1165}

◆ bCast() [5/22]

template<>
void olb::singleton::MpiManager::bCast ( bool * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1069 of file mpiManager.cpp.

1070{
1071 if (!ok) {
1072 return;
1073 }
1074 MPI_Bcast(static_cast<void*>(sendBuf),
1075 sendCount, MPI_BYTE, root, comm);
1076}

◆ bCast() [6/22]

template<>
void olb::singleton::MpiManager::bCast ( char & sendVal,
int root,
MPI_Comm comm )

Definition at line 1167 of file mpiManager.cpp.

1168{
1169 if (!ok) {
1170 return;
1171 }
1172 MPI_Bcast(&sendVal, 1, MPI_CHAR, root, comm);
1173}

◆ bCast() [7/22]

template<>
void olb::singleton::MpiManager::bCast ( char * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1079 of file mpiManager.cpp.

1080{
1081 if (!ok) {
1082 return;
1083 }
1084 MPI_Bcast(static_cast<void*>(sendBuf),
1085 sendCount, MPI_CHAR, root, comm);
1086}

◆ bCast() [8/22]

template<>
void olb::singleton::MpiManager::bCast ( double & sendVal,
int root,
MPI_Comm comm )

Definition at line 1212 of file mpiManager.cpp.

1213{
1214 if (!ok) {
1215 return;
1216 }
1217 MPI_Bcast(&sendVal, 1, MPI_DOUBLE, root, comm);
1218}

◆ bCast() [9/22]

template<>
void olb::singleton::MpiManager::bCast ( double * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1129 of file mpiManager.cpp.

1130{
1131 if (!ok) {
1132 return;
1133 }
1134 MPI_Bcast(static_cast<void*>(sendBuf),
1135 sendCount, MPI_DOUBLE, root, comm);
1136}

◆ bCast() [10/22]

template<>
void olb::singleton::MpiManager::bCast ( float & sendVal,
int root,
MPI_Comm comm )

Definition at line 1203 of file mpiManager.cpp.

1204{
1205 if (!ok) {
1206 return;
1207 }
1208 MPI_Bcast(&sendVal, 1, MPI_FLOAT, root, comm);
1209}

◆ bCast() [11/22]

template<>
void olb::singleton::MpiManager::bCast ( float * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1119 of file mpiManager.cpp.

1120{
1121 if (!ok) {
1122 return;
1123 }
1124 MPI_Bcast(static_cast<void*>(sendBuf),
1125 sendCount, MPI_FLOAT, root, comm);
1126}

◆ bCast() [12/22]

template<>
void olb::singleton::MpiManager::bCast ( int & sendVal,
int root,
MPI_Comm comm )

Definition at line 1185 of file mpiManager.cpp.

1186{
1187 if (!ok) {
1188 return;
1189 }
1190 MPI_Bcast(&sendVal, 1, MPI_INT, root, comm);
1191}

◆ bCast() [13/22]

template<>
void olb::singleton::MpiManager::bCast ( int * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1099 of file mpiManager.cpp.

1100{
1101 if (!ok) {
1102 return;
1103 }
1104 MPI_Bcast(static_cast<void*>(sendBuf),
1105 sendCount, MPI_INT, root, comm);
1106}

◆ bCast() [14/22]

void olb::singleton::MpiManager::bCast ( std::string & message,
int root = 0 )

Special case for broadcasting strings. Memory handling is automatic.

◆ bCast() [15/22]

template<typename T >
void olb::singleton::MpiManager::bCast ( T & sendVal,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

◆ bCast() [16/22]

template<typename T >
void olb::singleton::MpiManager::bCast ( T * sendBuf,
int sendCount,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Broadcast data from one processor to multiple processors.

+ Here is the caller graph for this function:

◆ bCast() [17/22]

template<>
void olb::singleton::MpiManager::bCast ( unsigned char & sendVal,
int root,
MPI_Comm comm )

Definition at line 1176 of file mpiManager.cpp.

1177{
1178 if (!ok) {
1179 return;
1180 }
1181 MPI_Bcast(&sendVal, 1, MPI_UNSIGNED_CHAR, root, comm);
1182}

◆ bCast() [18/22]

template<>
void olb::singleton::MpiManager::bCast ( unsigned char * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1089 of file mpiManager.cpp.

1090{
1091 if (!ok) {
1092 return;
1093 }
1094 MPI_Bcast(static_cast<void*>(sendBuf),
1095 sendCount, MPI_UNSIGNED_CHAR, root, comm);
1096}

◆ bCast() [19/22]

template<>
void olb::singleton::MpiManager::bCast ( unsigned long & sendVal,
int root,
MPI_Comm comm )

Definition at line 1194 of file mpiManager.cpp.

1195{
1196 if (!ok) {
1197 return;
1198 }
1199 MPI_Bcast(&sendVal, 1, MPI_UNSIGNED_LONG, root, comm);
1200}

◆ bCast() [20/22]

template<>
void olb::singleton::MpiManager::bCast ( unsigned long * sendBuf,
int sendCount,
int root,
MPI_Comm comm )

Definition at line 1109 of file mpiManager.cpp.

1110{
1111 if (!ok) {
1112 return;
1113 }
1114 MPI_Bcast(static_cast<void*>(sendBuf),
1115 sendCount, MPI_UNSIGNED_LONG, root, comm);
1116}

◆ bCast() [21/22]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::bCast ( util::ADf< T, DIM > * sendBuf,
int sendCount,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 124 of file mpiManagerAD.hh.

125{
126 if (!ok) {
127 return;
128 }
129 MPI_Bcast(static_cast<void*>(sendBuf),
130 (sizeof(util::ADf<T,DIM>)/8)*sendCount, MPI_DOUBLE, root, comm);
131}

◆ bCast() [22/22]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::bCast ( Vector< T, DIM > & sendData,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )
inline

Definition at line 218 of file mpiManager.h.

218 {
219 bCast(sendData.data(), DIM, root, comm);
220 }
void bCast(T *sendBuf, int sendCount, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Broadcast data from one processor to multiple processors.

References bCast(), and olb::Vector< T, Size >::data().

+ Here is the call graph for this function:

◆ bCastThroughMaster() [1/7]

template<>
void olb::singleton::MpiManager::bCastThroughMaster ( bool * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 1221 of file mpiManager.cpp.

1222{
1223 if (!ok) {
1224 return;
1225 }
1226 if (iAmRoot && !isMainProcessor()) {
1227 send(sendBuf, sendCount, 0);
1228 }
1229 if (isMainProcessor() && !iAmRoot) {
1230 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
1231 }
1232 bCast(sendBuf, sendCount, 0);
1233}
void send(T *buf, int count, int dest, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
Sends data at *buf, blocking.
bool isMainProcessor() const
Tells whether current processor is main processor.
void receive(T *buf, int count, int source, int tag=0, MPI_Comm comm=MPI_COMM_WORLD)
Receives data at *buf, blocking.

References bCast(), isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ bCastThroughMaster() [2/7]

template<>
void olb::singleton::MpiManager::bCastThroughMaster ( char * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 1236 of file mpiManager.cpp.

1237{
1238 if (!ok) {
1239 return;
1240 }
1241 if (iAmRoot && !isMainProcessor()) {
1242 send(sendBuf, sendCount, 0);
1243 }
1244 if (isMainProcessor() && !iAmRoot) {
1245 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
1246 }
1247 bCast(sendBuf, sendCount, 0);
1248}

References bCast(), isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ bCastThroughMaster() [3/7]

template<>
void olb::singleton::MpiManager::bCastThroughMaster ( double * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 1281 of file mpiManager.cpp.

1282{
1283 if (!ok) {
1284 return;
1285 }
1286 if (iAmRoot && !isMainProcessor()) {
1287 send(sendBuf, sendCount, 0);
1288 }
1289 if (isMainProcessor() && !iAmRoot) {
1290 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
1291 }
1292 bCast(sendBuf, sendCount, 0);
1293}

References bCast(), isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ bCastThroughMaster() [4/7]

template<>
void olb::singleton::MpiManager::bCastThroughMaster ( float * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 1266 of file mpiManager.cpp.

1267{
1268 if (!ok) {
1269 return;
1270 }
1271 if (iAmRoot && !isMainProcessor()) {
1272 send(sendBuf, sendCount, 0);
1273 }
1274 if (isMainProcessor() && !iAmRoot) {
1275 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
1276 }
1277 bCast(sendBuf, sendCount, 0);
1278}

References bCast(), isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ bCastThroughMaster() [5/7]

template<>
void olb::singleton::MpiManager::bCastThroughMaster ( int * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 1251 of file mpiManager.cpp.

1252{
1253 if (!ok) {
1254 return;
1255 }
1256 if (iAmRoot && !isMainProcessor()) {
1257 send(sendBuf, sendCount, 0);
1258 }
1259 if (isMainProcessor() && !iAmRoot) {
1260 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
1261 }
1262 bCast(sendBuf, sendCount, 0);
1263}

References bCast(), isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ bCastThroughMaster() [6/7]

template<typename T >
void olb::singleton::MpiManager::bCastThroughMaster ( T * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm = MPI_COMM_WORLD )

Broadcast data when root is unknown to other processors.

◆ bCastThroughMaster() [7/7]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::bCastThroughMaster ( util::ADf< T, DIM > * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 188 of file mpiManagerAD.hh.

189{
190 if (!ok) {
191 return;
192 }
193 if (iAmRoot && !isMainProcessor()) {
194 send(sendBuf, sendCount, 0);
195 }
196 if (isMainProcessor() && !iAmRoot) {
197 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
198 }
199 bCast(sendBuf, sendCount, 0);
200}

References bCast(), isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ bossId()

int olb::singleton::MpiManager::bossId ( ) const

Returns process ID of main processor.

Definition at line 75 of file mpiManager.cpp.

76{
77 return 0;
78}
+ Here is the caller graph for this function:

◆ gather() [1/2]

template<>
void olb::singleton::MpiManager::gather ( int * sendBuf,
int sendCount,
int * recvBuf,
int recvCount,
int root,
MPI_Comm comm )

Definition at line 766 of file mpiManager.cpp.

769{
770 if (!ok) {
771 return;
772 }
773 MPI_Gather(static_cast<void*>(sendBuf), sendCount, MPI_INT,
774 static_cast<void*>(recvBuf), recvCount, MPI_INT,
775 root, comm);
776}

◆ gather() [2/2]

template<typename T >
void olb::singleton::MpiManager::gather ( T * sendBuf,
int sendCount,
T * recvBuf,
int recvCount,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Gather data from multiple processors to one processor.

+ Here is the caller graph for this function:

◆ gatherv() [1/6]

template<>
void olb::singleton::MpiManager::gatherv ( bool * sendBuf,
int sendCount,
bool * recvBuf,
int * recvCounts,
int * displs,
int root,
MPI_Comm comm )

Definition at line 885 of file mpiManager.cpp.

888{
889 if (!ok) {
890 return;
891 }
892 MPI_Gatherv(static_cast<void*>(sendBuf), sendCount, MPI_BYTE,
893 static_cast<void*>(recvBuf), recvCounts, displs, MPI_BYTE,
894 root, comm);
895}

◆ gatherv() [2/6]

template<>
void olb::singleton::MpiManager::gatherv ( char * sendBuf,
int sendCount,
char * recvBuf,
int * recvCounts,
int * displs,
int root,
MPI_Comm comm )

Definition at line 898 of file mpiManager.cpp.

901{
902 if (!ok) {
903 return;
904 }
905 MPI_Gatherv(static_cast<void*>(sendBuf), sendCount, MPI_CHAR,
906 static_cast<void*>(recvBuf), recvCounts, displs, MPI_CHAR,
907 root, comm);
908}

◆ gatherv() [3/6]

template<>
void olb::singleton::MpiManager::gatherv ( double * sendBuf,
int sendCount,
double * recvBuf,
int * recvCounts,
int * displs,
int root,
MPI_Comm comm )

Definition at line 937 of file mpiManager.cpp.

940{
941 if (!ok) {
942 return;
943 }
944 MPI_Gatherv(static_cast<void*>(sendBuf), sendCount, MPI_DOUBLE,
945 static_cast<void*>(recvBuf), recvCounts, displs, MPI_DOUBLE,
946 root, comm);
947}

◆ gatherv() [4/6]

template<>
void olb::singleton::MpiManager::gatherv ( float * sendBuf,
int sendCount,
float * recvBuf,
int * recvCounts,
int * displs,
int root,
MPI_Comm comm )

Definition at line 924 of file mpiManager.cpp.

927{
928 if (!ok) {
929 return;
930 }
931 MPI_Gatherv(static_cast<void*>(sendBuf), sendCount, MPI_FLOAT,
932 static_cast<void*>(recvBuf), recvCounts, displs, MPI_FLOAT,
933 root, comm);
934}

◆ gatherv() [5/6]

template<>
void olb::singleton::MpiManager::gatherv ( int * sendBuf,
int sendCount,
int * recvBuf,
int * recvCounts,
int * displs,
int root,
MPI_Comm comm )

Definition at line 911 of file mpiManager.cpp.

914{
915 if (!ok) {
916 return;
917 }
918 MPI_Gatherv(static_cast<void*>(sendBuf), sendCount, MPI_INT,
919 static_cast<void*>(recvBuf), recvCounts, displs, MPI_INT,
920 root, comm);
921}

◆ gatherv() [6/6]

template<typename T >
void olb::singleton::MpiManager::gatherv ( T * sendBuf,
int sendCount,
T * recvBuf,
int * recvCounts,
int * displs,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Gather data from multiple processors to one processor.

+ Here is the caller graph for this function:

◆ getRank()

int olb::singleton::MpiManager::getRank ( ) const

Returns the process ID.

Definition at line 70 of file mpiManager.cpp.

71{
72 return taskId;
73}
+ Here is the caller graph for this function:

◆ getSize()

int olb::singleton::MpiManager::getSize ( ) const

Returns the number of processes.

Definition at line 65 of file mpiManager.cpp.

66{
67 return numTasks;
68}
+ Here is the caller graph for this function:

◆ getTime()

double olb::singleton::MpiManager::getTime ( ) const

Returns universal MPI-time in seconds.

Definition at line 85 of file mpiManager.cpp.

86{
87 if (!ok) {
88 return 0.;
89 }
90 return MPI_Wtime();
91}

◆ ibSend() [1/7]

template<>
void olb::singleton::MpiManager::ibSend ( bool * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 292 of file mpiManager.cpp.

294{
295 if (ok) {
296 MPI_Ibsend(static_cast<void*>(buf), count, MPI_BYTE, dest, tag, comm, request);
297 }
298}

◆ ibSend() [2/7]

template<>
void olb::singleton::MpiManager::ibSend ( char * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 301 of file mpiManager.cpp.

303{
304 if (ok) {
305 MPI_Ibsend(static_cast<void*>(buf), count, MPI_CHAR, dest, tag, comm, request);
306 }
307}

◆ ibSend() [3/7]

template<>
void olb::singleton::MpiManager::ibSend ( double * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 328 of file mpiManager.cpp.

330{
331 if (ok) {
332 MPI_Ibsend(static_cast<void*>(buf), count, MPI_DOUBLE, dest, tag, comm, request);
333 }
334}

◆ ibSend() [4/7]

template<>
void olb::singleton::MpiManager::ibSend ( float * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 319 of file mpiManager.cpp.

321{
322 if (ok) {
323 MPI_Ibsend(static_cast<void*>(buf), count, MPI_FLOAT, dest, tag, comm, request);
324 }
325}

◆ ibSend() [5/7]

template<>
void olb::singleton::MpiManager::ibSend ( int * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 310 of file mpiManager.cpp.

312{
313 if (ok) {
314 MPI_Ibsend(static_cast<void*>(buf), count, MPI_INT, dest, tag, comm, request);
315 }
316}

◆ ibSend() [6/7]

template<typename T >
void olb::singleton::MpiManager::ibSend ( T * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Sends data at *buf, non blocking and buffered.

◆ ibSend() [7/7]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::ibSend ( util::ADf< T, DIM > * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

◆ init()

void olb::singleton::MpiManager::init ( int * argc,
char *** argv,
bool verbose = true )

Initializes the mpi manager.

Definition at line 48 of file mpiManager.cpp.

49{
50 int ok0{};
51 MPI_Initialized(&ok0);
52 if (ok0) {
53 return;
54 }
55 int ok1 = MPI_Init(argc, argv);
56 int ok2 = MPI_Comm_rank(MPI_COMM_WORLD, &taskId);
57 int ok3 = MPI_Comm_size(MPI_COMM_WORLD, &numTasks);
58 int ok4 = MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
59 ok = (ok1 == MPI_SUCCESS && ok2 == MPI_SUCCESS && ok3 == MPI_SUCCESS && ok4 == MPI_SUCCESS);
60 if (verbose) {
61 clout << "Sucessfully initialized, numThreads=" << getSize() << std::endl;
62 }
63}
int getSize() const
Returns the number of processes.

References getSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ iRecv() [1/7]

template<>
void olb::singleton::MpiManager::iRecv ( bool * buf,
int count,
int source,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 549 of file mpiManager.cpp.

550{
551 if (ok) {
552 MPI_Irecv(static_cast<void*>(buf), count, MPI_BYTE, source, tag, comm, request);
553 }
554}

◆ iRecv() [2/7]

template<>
void olb::singleton::MpiManager::iRecv ( char * buf,
int count,
int source,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 557 of file mpiManager.cpp.

558{
559 if (ok) {
560 MPI_Irecv(static_cast<void*>(buf), count, MPI_CHAR, source, tag, comm, request);
561 }
562}

◆ iRecv() [3/7]

template<>
void olb::singleton::MpiManager::iRecv ( double * buf,
int count,
int source,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 581 of file mpiManager.cpp.

582{
583 if (ok) {
584 MPI_Irecv(static_cast<void*>(buf), count, MPI_DOUBLE, source, tag, comm, request);
585 }
586}

◆ iRecv() [4/7]

template<>
void olb::singleton::MpiManager::iRecv ( float * buf,
int count,
int source,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 573 of file mpiManager.cpp.

574{
575 if (ok) {
576 MPI_Irecv(static_cast<void*>(buf), count, MPI_FLOAT, source, tag, comm, request);
577 }
578}

◆ iRecv() [5/7]

template<>
void olb::singleton::MpiManager::iRecv ( int * buf,
int count,
int source,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 565 of file mpiManager.cpp.

566{
567 if (ok) {
568 MPI_Irecv(static_cast<void*>(buf), count, MPI_INT, source, tag, comm, request);
569 }
570}

◆ iRecv() [6/7]

template<typename T >
void olb::singleton::MpiManager::iRecv ( T * buf,
int count,
int source,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Receives data at *buf, non blocking.

◆ iRecv() [7/7]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::iRecv ( util::ADf< T, DIM > * buf,
int count,
int source,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 98 of file mpiManagerAD.hh.

99{
100 if (ok) {
101 MPI_Irecv(static_cast<void*>(buf), (sizeof(util::ADf<T,DIM>)/8)*count, MPI_DOUBLE, source, tag, comm, request);
102 }
103}

◆ iSend() [1/8]

template<>
void olb::singleton::MpiManager::iSend ( bool * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 210 of file mpiManager.cpp.

212{
213 if (ok) {
214 MPI_Isend(static_cast<void*>(buf), count, MPI_BYTE, dest, tag, comm, request);
215 }
216}

◆ iSend() [2/8]

template<>
void olb::singleton::MpiManager::iSend ( char * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 219 of file mpiManager.cpp.

221{
222 if (ok) {
223 MPI_Isend(static_cast<void*>(buf), count, MPI_CHAR, dest, tag, comm, request);
224 }
225}

◆ iSend() [3/8]

template<>
void olb::singleton::MpiManager::iSend ( double * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 273 of file mpiManager.cpp.

275{
276 if (ok) {
277 MPI_Isend(static_cast<void*>(buf), count, MPI_DOUBLE, dest, tag, comm, request);
278 }
279}

◆ iSend() [4/8]

template<>
void olb::singleton::MpiManager::iSend ( float * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 264 of file mpiManager.cpp.

266{
267 if (ok) {
268 MPI_Isend(static_cast<void*>(buf), count, MPI_FLOAT, dest, tag, comm, request);
269 }
270}

◆ iSend() [5/8]

template<>
void olb::singleton::MpiManager::iSend ( int * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 237 of file mpiManager.cpp.

239{
240 if (ok) {
241 MPI_Isend(static_cast<void*>(buf), count, MPI_INT, dest, tag, comm, request);
242 }
243}

◆ iSend() [6/8]

template<>
void olb::singleton::MpiManager::iSend ( long double * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 282 of file mpiManager.cpp.

284{
285 if (ok) {
286 MPI_Isend(static_cast<void*>(buf), count, MPI_LONG_DOUBLE, dest, tag, comm, request);
287 }
288}

◆ iSend() [7/8]

template<typename T >
void olb::singleton::MpiManager::iSend ( T * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Sends data at *buf, non blocking.

+ Here is the caller graph for this function:

◆ iSend() [8/8]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::iSend ( util::ADf< T, DIM > * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 85 of file mpiManagerAD.hh.

87{
88 if (ok) {
89 MPI_Isend(static_cast<void*>(buf), (sizeof(util::ADf<T,DIM>)/8)*count, MPI_DOUBLE, dest, tag, comm, request);
90 }
91}

◆ isMainProcessor()

bool olb::singleton::MpiManager::isMainProcessor ( ) const

Tells whether current processor is main processor.

Definition at line 80 of file mpiManager.cpp.

81{
82 return bossId() == getRank();
83}
int getRank() const
Returns the process ID.
int bossId() const
Returns process ID of main processor.

References bossId(), and getRank().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ probeReceiveSize() [1/2]

template<typename TYPE >
std::size_t olb::singleton::MpiManager::probeReceiveSize ( int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Probe size of incoming message with TYPE.

◆ probeReceiveSize() [2/2]

std::size_t olb::singleton::MpiManager::probeReceiveSize ( int source,
MPI_Datatype type,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Probe size of incoming message.

Definition at line 336 of file mpiManager.cpp.

337{
338 MPI_Status status;
339 if (MPI_Probe(source, tag, comm, &status) == MPI_SUCCESS) {
340 int requestSize;
341 MPI_Get_count(&status, type, &requestSize);
342 if (requestSize == MPI_UNDEFINED) {
343 throw std::runtime_error("MPI_UNDEFINED in probeReceiveSize(" + std::to_string(source) + "," + std::to_string(tag) + ")" + " ranks " + std::to_string(source) + " -> " + std::to_string(singleton::mpi().getRank()));
344 }
345 return requestSize;
346 } else {
347 throw std::runtime_error("MPI_Probe failed in probeReceiveSize");
348 }
349}
MpiManager & mpi()

References getRank(), and olb::singleton::mpi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive() [1/10]

template<>
void olb::singleton::MpiManager::receive ( bool * buf,
int count,
int source,
int tag,
MPI_Comm comm )

Definition at line 364 of file mpiManager.cpp.

365{
366 if (!ok) {
367 return;
368 }
369 MPI_Status status;
370 MPI_Recv(static_cast<void*>(buf), count, MPI_BYTE, source, tag, comm, &status);
371}

◆ receive() [2/10]

template<>
void olb::singleton::MpiManager::receive ( char * buf,
int count,
int source,
int tag,
MPI_Comm comm )

Definition at line 375 of file mpiManager.cpp.

376{
377 if (!ok) {
378 return;
379 }
380 MPI_Status status;
381 MPI_Recv(static_cast<void*>(buf), count, MPI_CHAR, source, tag, comm, &status);
382}

◆ receive() [3/10]

template<>
void olb::singleton::MpiManager::receive ( double * buf,
int count,
int source,
int tag,
MPI_Comm comm )

Definition at line 435 of file mpiManager.cpp.

436{
437 if (!ok) {
438 return;
439 }
440 MPI_Status status;
441 MPI_Recv(static_cast<void*>(buf), count, MPI_DOUBLE, source, tag, comm, &status);
442}

◆ receive() [4/10]

template<>
void olb::singleton::MpiManager::receive ( float * buf,
int count,
int source,
int tag,
MPI_Comm comm )

Definition at line 425 of file mpiManager.cpp.

426{
427 if (!ok) {
428 return;
429 }
430 MPI_Status status;
431 MPI_Recv(static_cast<void*>(buf), count, MPI_FLOAT, source, tag, comm, &status);
432}

◆ receive() [5/10]

template<>
void olb::singleton::MpiManager::receive ( int * buf,
int count,
int source,
int tag,
MPI_Comm comm )

Definition at line 395 of file mpiManager.cpp.

396{
397 if (!ok) {
398 return;
399 }
400 MPI_Status status;
401 MPI_Recv(static_cast<void*>(buf), count, MPI_INT, source, tag, comm, &status);
402}

◆ receive() [6/10]

template<>
void olb::singleton::MpiManager::receive ( long double * buf,
int count,
int source,
int tag,
MPI_Comm comm )

Definition at line 445 of file mpiManager.cpp.

446{
447 if (!ok) {
448 return;
449 }
450 MPI_Status status;
451 MPI_Recv(static_cast<void*>(buf), count, MPI_LONG_DOUBLE, source, tag, comm, &status);
452}

◆ receive() [7/10]

template<class T , std::size_t N>
void olb::singleton::MpiManager::receive ( std::array< T, N > & array,
int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )
inline

Definition at line 159 of file mpiManager.h.

159 {
160 receive( array.data(), array.size(), source, tag, comm );
161 }

References receive().

+ Here is the call graph for this function:

◆ receive() [8/10]

template<typename... args>
void olb::singleton::MpiManager::receive ( std::vector< args... > & vec,
int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )
inline

Definition at line 155 of file mpiManager.h.

155 {
156 receive( vec.data(), vec.size(), source, tag, comm );
157 }

References receive().

+ Here is the call graph for this function:

◆ receive() [9/10]

template<typename T >
void olb::singleton::MpiManager::receive ( T * buf,
int count,
int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Receives data at *buf, blocking.

+ Here is the caller graph for this function:

◆ receive() [10/10]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::receive ( util::ADf< T, DIM > * buf,
int count,
int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 66 of file mpiManagerAD.hh.

67{
68 if (!ok) {
69 return;
70 }
71 MPI_Status status;
72 MPI_Recv(static_cast<void*>(buf), (sizeof(util::ADf<T,DIM>)/8)*count, MPI_DOUBLE, source, tag, comm, &status);
73}

◆ recvInit() [1/4]

template<>
void olb::singleton::MpiManager::recvInit ( double * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 525 of file mpiManager.cpp.

526{
527 if (ok) {
528 MPI_Recv_init(buf, count, MPI_DOUBLE, dest, tag, comm, request);
529 }
530}

◆ recvInit() [2/4]

template<>
void olb::singleton::MpiManager::recvInit ( int * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 533 of file mpiManager.cpp.

534{
535 if (ok) {
536 MPI_Recv_init(buf, count, MPI_INT, dest, tag, comm, request);
537 }
538}

◆ recvInit() [3/4]

template<typename T >
void olb::singleton::MpiManager::recvInit ( T * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Initialize persistent non-blocking receive.

+ Here is the caller graph for this function:

◆ recvInit() [4/4]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::recvInit ( util::ADf< T, DIM > * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 76 of file mpiManagerAD.hh.

77{
78 if (ok) {
79 MPI_Recv_init(static_cast<void*>(buf), (sizeof(util::ADf<T,DIM>)/8)*count, MPI_DOUBLE, dest, tag, comm, request);
80 }
81}

◆ reduce() [1/13]

template<>
void olb::singleton::MpiManager::reduce ( BlockData< 2, double, double > & sendVal,
BlockData< 2, double, double > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 188 of file blockData.hh.

189{
190 if (!ok) {
191 return;
192 }
193 for (unsigned iD=0; iD < sendVal.getSize(); ++iD) {
194 MPI_Reduce(static_cast<void*>(sendVal.getColumn(iD).data()),
195 static_cast<void*>(recvVal.getColumn(iD).data()),
196 sendVal.getNcells(), MPI_DOUBLE, op, root, comm);
197 }
198}

◆ reduce() [2/13]

template<>
void olb::singleton::MpiManager::reduce ( BlockData< 2, double, int > & sendVal,
BlockData< 2, double, int > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 175 of file blockData.hh.

176{
177 if (!ok) {
178 return;
179 }
180 for (unsigned iD=0; iD < sendVal.getSize(); ++iD) {
181 MPI_Reduce(static_cast<void*>(sendVal.getColumn(iD).data()),
182 static_cast<void*>(recvVal.getColumn(iD).data()),
183 sendVal.getNcells(), MPI_DOUBLE, op, root, comm);
184 }
185}

◆ reduce() [3/13]

template<>
void olb::singleton::MpiManager::reduce ( BlockData< 2, float, float > & sendVal,
BlockData< 2, float, float > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 201 of file blockData.hh.

202{
203 if (!ok) {
204 return;
205 }
206 for (unsigned iD=0; iD < sendVal.getSize(); ++iD) {
207 MPI_Reduce(static_cast<void*>(sendVal.getColumn(iD).data()),
208 static_cast<void*>(recvVal.getColumn(iD).data()),
209 sendVal.getNcells(), MPI_FLOAT, op, root, comm);
210 }
211}

◆ reduce() [4/13]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::reduce ( BlockData< 2, util::ADf< T, DIM >, util::ADf< T, DIM > > & sendVal,
BlockData< 2, util::ADf< T, DIM >, util::ADf< T, DIM > > & recvVal,
MPI_Op op,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 168 of file mpiManagerAD.hh.

172{
173 if (!ok) {
174 return;
175 }
176// MPI_Reduce(static_cast<void*>(sendVal.getRawData()),
177// static_cast<void*>(recvVal.getRawData()),
178// sendVal.getDataSize(), MPI_DOUBLE, op, root, comm);
179 for (unsigned iD=0; iD < sendVal.getSize(); ++iD) {
180 MPI_Reduce(static_cast<void*>(sendVal.getColumn(iD).data()),
181 static_cast<void*>(recvVal.getColumn(iD).data()),
182 sendVal.getNcells(), MPI_DOUBLE, op, root, comm);
183 }
184}

◆ reduce() [5/13]

template<>
void olb::singleton::MpiManager::reduce ( bool & sendVal,
bool & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1296 of file mpiManager.cpp.

1297{
1298 if (!ok) {
1299 return;
1300 }
1301 MPI_Reduce(static_cast<void*>(&sendVal),
1302 static_cast<void*>(&recvVal), 1, MPI_BYTE, op, root, comm);
1303}

◆ reduce() [6/13]

template<>
void olb::singleton::MpiManager::reduce ( char & sendVal,
char & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1306 of file mpiManager.cpp.

1307{
1308 if (!ok) {
1309 return;
1310 }
1311 MPI_Reduce(static_cast<void*>(&sendVal),
1312 static_cast<void*>(&recvVal), 1, MPI_CHAR, op, root, comm);
1313}

◆ reduce() [7/13]

template<>
void olb::singleton::MpiManager::reduce ( double & sendVal,
double & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1345 of file mpiManager.cpp.

1346{
1347 if (!ok) {
1348 return;
1349 }
1350 MPI_Reduce(static_cast<void*>(&sendVal),
1351 static_cast<void*>(&recvVal), 1, MPI_DOUBLE, op, root, comm);
1352}

◆ reduce() [8/13]

template<>
void olb::singleton::MpiManager::reduce ( float & sendVal,
float & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1326 of file mpiManager.cpp.

1327{
1328 if (!ok) {
1329 return;
1330 }
1331 MPI_Reduce(static_cast<void*>(&sendVal),
1332 static_cast<void*>(&recvVal), 1, MPI_FLOAT, op, root, comm);
1333}

◆ reduce() [9/13]

template<>
void olb::singleton::MpiManager::reduce ( float * sendVal,
float * recvVal,
int count,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1336 of file mpiManager.cpp.

1337{
1338 if (!ok) {
1339 return;
1340 }
1341 MPI_Reduce(sendVal, recvVal, count, MPI_FLOAT, op, root, comm);
1342}

◆ reduce() [10/13]

template<>
void olb::singleton::MpiManager::reduce ( int & sendVal,
int & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1316 of file mpiManager.cpp.

1317{
1318 if (!ok) {
1319 return;
1320 }
1321 MPI_Reduce(static_cast<void*>(&sendVal),
1322 static_cast<void*>(&recvVal), 1, MPI_INT, op, root, comm);
1323}

◆ reduce() [11/13]

template<typename T >
void olb::singleton::MpiManager::reduce ( T & sendVal,
T & recvVal,
MPI_Op op,
int root = 0,
MPI_Comm = MPI_COMM_WORLD )

Reduction operation toward one processor.

+ Here is the caller graph for this function:

◆ reduce() [12/13]

template<typename T >
void olb::singleton::MpiManager::reduce ( T * sendVal,
T * recvVal,
int count,
MPI_Op op,
int root = 0,
MPI_Comm = MPI_COMM_WORLD )

◆ reduce() [13/13]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::reduce ( util::ADf< T, DIM > & sendVal,
util::ADf< T, DIM > & recvVal,
MPI_Op op,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 150 of file mpiManagerAD.hh.

151{
152 if (!ok) {
153 return;
154 }
155
156 int sizeADouble = sizeof(util::ADf<T,DIM>)/8-1;
157
158 MPI_Reduce(static_cast<void*>(&sendVal.v()),
159 static_cast<void*>(&recvVal.v()), 1, MPI_DOUBLE, op, root, comm);
160
161 for (int i=0; i<sizeADouble; i++) {
162 MPI_Reduce(static_cast<void*>(&sendVal.d(i)),
163 static_cast<void*>(&recvVal.d(i)), 1, MPI_DOUBLE, op, root, comm);
164 }
165}

References olb::util::ADf< T, DIM >::d(), and olb::util::ADf< T, DIM >::v().

+ Here is the call graph for this function:

◆ reduceAndBcast() [1/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( bool & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1413 of file mpiManager.cpp.

1414{
1415 if (!ok) {
1416 return;
1417 }
1418 char recvVal;
1419 MPI_Reduce(static_cast<void*>(&reductVal), static_cast<void*>(&recvVal), 1, MPI_BYTE, op, root, comm);
1420 reductVal = recvVal;
1421 MPI_Bcast(&reductVal, 1, MPI_BYTE, root, comm);
1422
1423}

◆ reduceAndBcast() [2/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( char & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1426 of file mpiManager.cpp.

1427{
1428 if (!ok) {
1429 return;
1430 }
1431 char recvVal;
1432 MPI_Reduce(&reductVal, &recvVal, 1, MPI_CHAR, op, root, comm);
1433 reductVal = recvVal;
1434 MPI_Bcast(&reductVal, 1, MPI_CHAR, root, comm);
1435
1436}

◆ reduceAndBcast() [3/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( double & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1464 of file mpiManager.cpp.

1465{
1466 if (!ok) {
1467 return;
1468 }
1469 double recvVal;
1470 MPI_Reduce(&reductVal, &recvVal, 1, MPI_DOUBLE, op, root, comm);
1471 reductVal = recvVal;
1472 MPI_Bcast(&reductVal, 1, MPI_DOUBLE, root, comm);
1473
1474}

◆ reduceAndBcast() [4/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( float & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1452 of file mpiManager.cpp.

1453{
1454 if (!ok) {
1455 return;
1456 }
1457 float recvVal;
1458 MPI_Reduce(&reductVal, &recvVal, 1, MPI_FLOAT, op, root, comm);
1459 reductVal = recvVal;
1460 MPI_Bcast(&reductVal, 1, MPI_FLOAT, root, comm);
1461}

◆ reduceAndBcast() [5/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( int & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1439 of file mpiManager.cpp.

1440{
1441 if (!ok) {
1442 return;
1443 }
1444 int recvVal;
1445 MPI_Reduce(&reductVal, &recvVal, 1, MPI_INT, op, root, comm);
1446 reductVal = recvVal;
1447 MPI_Bcast(&reductVal, 1, MPI_INT, root, comm);
1448}

◆ reduceAndBcast() [6/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( long & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1490 of file mpiManager.cpp.

1491{
1492 if (!ok) {
1493 return;
1494 }
1495 long recvVal;
1496 MPI_Reduce(&reductVal, &recvVal, 1, MPI_LONG, op, root, comm);
1497 reductVal = recvVal;
1498 MPI_Bcast(&reductVal, 1, MPI_LONG, root, comm);
1499
1500}

◆ reduceAndBcast() [7/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( long double & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1477 of file mpiManager.cpp.

1478{
1479 if (!ok) {
1480 return;
1481 }
1482 long double recvVal;
1483 MPI_Reduce(&reductVal, &recvVal, 1, MPI_LONG_DOUBLE, op, root, comm);
1484 reductVal = recvVal;
1485 MPI_Bcast(&reductVal, 1, MPI_LONG_DOUBLE, root, comm);
1486
1487}

◆ reduceAndBcast() [8/10]

template<typename T >
void olb::singleton::MpiManager::reduceAndBcast ( T & reductVal,
MPI_Op op,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Reduction operation, followed by a broadcast.

+ Here is the caller graph for this function:

◆ reduceAndBcast() [9/10]

template<>
void olb::singleton::MpiManager::reduceAndBcast ( unsigned long & reductVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1503 of file mpiManager.cpp.

1504{
1505 if (!ok) {
1506 return;
1507 }
1508 unsigned long recvVal;
1509 MPI_Reduce(&reductVal, &recvVal, 1, MPI_UNSIGNED_LONG, op, root, comm);
1510 reductVal = recvVal;
1511 MPI_Bcast(&reductVal, 1, MPI_UNSIGNED_LONG, root, comm);
1512
1513}

◆ reduceAndBcast() [10/10]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::reduceAndBcast ( util::ADf< T, DIM > & reductVal,
MPI_Op op,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 203 of file mpiManagerAD.hh.

204{
205 if (!ok) {
206 return;
207 }
208 util::ADf<T,DIM> recvVal;
209 reduce(reductVal, recvVal, op, root, comm);
210
211 //MPI_Reduce(&reductVal, &recvVal, 1, MPI_DOUBLE, op, root, comm);
212 reductVal = recvVal;
213 bCast(&reductVal, 1, root, comm);
214
215 //MPI_Bcast(&reductVal, 1, MPI_DOUBLE, root, comm);
216
217}
void reduce(T &sendVal, T &recvVal, MPI_Op op, int root=0, MPI_Comm=MPI_COMM_WORLD)
Reduction operation toward one processor.

References bCast(), and reduce().

+ Here is the call graph for this function:

◆ reduceVect() [1/5]

template<>
void olb::singleton::MpiManager::reduceVect ( std::vector< char > & sendVal,
std::vector< char > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1365 of file mpiManager.cpp.

1367{
1368 if (!ok) {
1369 return;
1370 }
1371 MPI_Reduce(static_cast<void*>(&(sendVal[0])),
1372 static_cast<void*>(&(recvVal[0])),
1373 sendVal.size(), MPI_CHAR, op, root, comm);
1374}

◆ reduceVect() [2/5]

template<>
void olb::singleton::MpiManager::reduceVect ( std::vector< double > & sendVal,
std::vector< double > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1401 of file mpiManager.cpp.

1403{
1404 if (!ok) {
1405 return;
1406 }
1407 MPI_Reduce(static_cast<void*>(&(sendVal[0])),
1408 static_cast<void*>(&(recvVal[0])),
1409 sendVal.size(), MPI_DOUBLE, op, root, comm);
1410}

◆ reduceVect() [3/5]

template<>
void olb::singleton::MpiManager::reduceVect ( std::vector< float > & sendVal,
std::vector< float > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1389 of file mpiManager.cpp.

1391{
1392 if (!ok) {
1393 return;
1394 }
1395 MPI_Reduce(static_cast<void*>(&(sendVal[0])),
1396 static_cast<void*>(&(recvVal[0])),
1397 sendVal.size(), MPI_FLOAT, op, root, comm);
1398}

◆ reduceVect() [4/5]

template<>
void olb::singleton::MpiManager::reduceVect ( std::vector< int > & sendVal,
std::vector< int > & recvVal,
MPI_Op op,
int root,
MPI_Comm comm )

Definition at line 1377 of file mpiManager.cpp.

1379{
1380 if (!ok) {
1381 return;
1382 }
1383 MPI_Reduce(static_cast<void*>(&(sendVal[0])),
1384 static_cast<void*>(&(recvVal[0])),
1385 sendVal.size(), MPI_INT, op, root, comm);
1386}

◆ reduceVect() [5/5]

template<typename T >
void olb::singleton::MpiManager::reduceVect ( std::vector< T > & sendVal,
std::vector< T > & recvVal,
MPI_Op op,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Element-per-element reduction of a vector of data.

+ Here is the caller graph for this function:

◆ scatterv() [1/6]

template<>
void olb::singleton::MpiManager::scatterv ( bool * sendBuf,
int * sendCounts,
int * displs,
bool * recvBuf,
int recvCount,
int root,
MPI_Comm comm )

Definition at line 701 of file mpiManager.cpp.

703{
704 if (!ok) {
705 return;
706 }
707 MPI_Scatterv(static_cast<void*>(sendBuf),
708 sendCounts, displs, MPI_BYTE,
709 static_cast<void*>(recvBuf),
710 recvCount, MPI_BYTE, root, comm);
711}

◆ scatterv() [2/6]

template<>
void olb::singleton::MpiManager::scatterv ( char * sendBuf,
int * sendCounts,
int * displs,
char * recvBuf,
int recvCount,
int root,
MPI_Comm comm )

Definition at line 714 of file mpiManager.cpp.

716{
717 if (!ok) {
718 return;
719 }
720 MPI_Scatterv(static_cast<void*>(sendBuf),
721 sendCounts, displs, MPI_CHAR,
722 static_cast<void*>(recvBuf),
723 recvCount, MPI_CHAR, root, comm);
724}

◆ scatterv() [3/6]

template<>
void olb::singleton::MpiManager::scatterv ( double * sendBuf,
int * sendCounts,
int * displs,
double * recvBuf,
int recvCount,
int root,
MPI_Comm comm )

Definition at line 753 of file mpiManager.cpp.

755{
756 if (!ok) {
757 return;
758 }
759 MPI_Scatterv(static_cast<void*>(sendBuf),
760 sendCounts, displs, MPI_DOUBLE,
761 static_cast<void*>(recvBuf),
762 recvCount, MPI_DOUBLE, root, comm);
763}

◆ scatterv() [4/6]

template<>
void olb::singleton::MpiManager::scatterv ( float * sendBuf,
int * sendCounts,
int * displs,
float * recvBuf,
int recvCount,
int root,
MPI_Comm comm )

Definition at line 740 of file mpiManager.cpp.

742{
743 if (!ok) {
744 return;
745 }
746 MPI_Scatterv(static_cast<void*>(sendBuf),
747 sendCounts, displs, MPI_FLOAT,
748 static_cast<void*>(recvBuf),
749 recvCount, MPI_FLOAT, root, comm);
750}

◆ scatterv() [5/6]

template<>
void olb::singleton::MpiManager::scatterv ( int * sendBuf,
int * sendCounts,
int * displs,
int * recvBuf,
int recvCount,
int root,
MPI_Comm comm )

Definition at line 727 of file mpiManager.cpp.

729{
730 if (!ok) {
731 return;
732 }
733 MPI_Scatterv(static_cast<void*>(sendBuf),
734 sendCounts, displs, MPI_INT,
735 static_cast<void*>(recvBuf),
736 recvCount, MPI_INT, root, comm);
737}

◆ scatterv() [6/6]

template<typename T >
void olb::singleton::MpiManager::scatterv ( T * sendBuf,
int * sendCounts,
int * displs,
T * recvBuf,
int recvCount,
int root = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Scatter data from one processor over multiple processors.

◆ send() [1/9]

template<>
void olb::singleton::MpiManager::send ( bool * buf,
int count,
int dest,
int tag,
MPI_Comm comm )

Definition at line 108 of file mpiManager.cpp.

109{
110 if (!ok) {
111 return;
112 }
113 MPI_Send(static_cast<void*>(buf), count, MPI_BYTE, dest, tag, comm);
114}

◆ send() [2/9]

template<>
void olb::singleton::MpiManager::send ( char * buf,
int count,
int dest,
int tag,
MPI_Comm comm )

Definition at line 117 of file mpiManager.cpp.

118{
119 if (!ok) {
120 return;
121 }
122 MPI_Send(static_cast<void*>(buf), count, MPI_CHAR, dest, tag, comm);
123}

◆ send() [3/9]

template<>
void olb::singleton::MpiManager::send ( double * buf,
int count,
int dest,
int tag,
MPI_Comm comm )

Definition at line 153 of file mpiManager.cpp.

154{
155 if (!ok) {
156 return;
157 }
158 MPI_Send(static_cast<void*>(buf), count, MPI_DOUBLE, dest, tag, comm);
159}

◆ send() [4/9]

template<>
void olb::singleton::MpiManager::send ( float * buf,
int count,
int dest,
int tag,
MPI_Comm comm )

Definition at line 144 of file mpiManager.cpp.

145{
146 if (!ok) {
147 return;
148 }
149 MPI_Send(static_cast<void*>(buf), count, MPI_FLOAT, dest, tag, comm);
150}

◆ send() [5/9]

template<>
void olb::singleton::MpiManager::send ( int * buf,
int count,
int dest,
int tag,
MPI_Comm comm )

Definition at line 135 of file mpiManager.cpp.

136{
137 if (!ok) {
138 return;
139 }
140 MPI_Send(static_cast<void*>(buf), count, MPI_INT, dest, tag, comm);
141}

◆ send() [6/9]

template<class T , std::size_t N>
void olb::singleton::MpiManager::send ( std::array< T, N > & array,
int dest,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )
inline

Definition at line 121 of file mpiManager.h.

121 {
122 send( array.data(), array.size(), dest, tag, comm );
123 }

References send().

+ Here is the call graph for this function:

◆ send() [7/9]

template<typename... args>
void olb::singleton::MpiManager::send ( std::vector< args... > & vec,
int dest,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )
inline

Definition at line 117 of file mpiManager.h.

117 {
118 send( vec.data(), vec.size(), dest, tag, comm );
119 }

References send().

+ Here is the call graph for this function:

◆ send() [8/9]

template<typename T >
void olb::singleton::MpiManager::send ( T * buf,
int count,
int dest,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Sends data at *buf, blocking.

+ Here is the caller graph for this function:

◆ send() [9/9]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::send ( util::ADf< T, DIM > * buf,
int count,
int dest,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 49 of file mpiManagerAD.hh.

50{
51 if (!ok) {
52 return;
53 }
54 MPI_Send(static_cast<void*>(buf), (sizeof(util::ADf<T,DIM>)/8)*count, MPI_DOUBLE, dest, tag, comm);
55}

◆ sendInit() [1/5]

template<>
void olb::singleton::MpiManager::sendInit ( bool * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 202 of file mpiManager.cpp.

203{
204 if (ok) {
205 MPI_Send_init(static_cast<void*>(buf), count, MPI_BYTE, dest, tag, comm, request);
206 }
207}

◆ sendInit() [2/5]

template<>
void olb::singleton::MpiManager::sendInit ( double * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 162 of file mpiManager.cpp.

163{
164 if (ok) {
165 MPI_Send_init(buf, count, MPI_DOUBLE, dest, tag, comm, request);
166 }
167}

◆ sendInit() [3/5]

template<>
void olb::singleton::MpiManager::sendInit ( int * buf,
int count,
int dest,
MPI_Request * request,
int tag,
MPI_Comm comm )

Definition at line 194 of file mpiManager.cpp.

195{
196 if (ok) {
197 MPI_Send_init(buf, count, MPI_INT, dest, tag, comm, request);
198 }
199}

◆ sendInit() [4/5]

template<typename T >
void olb::singleton::MpiManager::sendInit ( T * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Initialize persistent non-blocking send.

+ Here is the caller graph for this function:

◆ sendInit() [5/5]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::sendInit ( util::ADf< T, DIM > * buf,
int count,
int dest,
MPI_Request * request,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 58 of file mpiManagerAD.hh.

59{
60 if (ok) {
61 MPI_Send_init(static_cast<void*>(buf), (sizeof(util::ADf<T,DIM>)/8)*count, MPI_DOUBLE, dest, tag, comm, request);
62 }
63}

◆ sendRecv() [1/9]

template<>
void olb::singleton::MpiManager::sendRecv ( bool * sendBuf,
bool * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 589 of file mpiManager.cpp.

591{
592 if (!ok) {
593 return;
594 }
595 MPI_Status status;
596 MPI_Sendrecv(static_cast<void*>(sendBuf),
597 count,
598 MPI_BYTE, dest, tag,
599 static_cast<void*>(recvBuf),
600 count,
601 MPI_BYTE, source, tag, comm, &status);
602}

◆ sendRecv() [2/9]

template<>
void olb::singleton::MpiManager::sendRecv ( char * sendBuf,
char * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 605 of file mpiManager.cpp.

607{
608 if (!ok) {
609 return;
610 }
611 MPI_Status status;
612 MPI_Sendrecv(static_cast<void*>(sendBuf),
613 count,
614 MPI_CHAR, dest, tag,
615 static_cast<void*>(recvBuf),
616 count,
617 MPI_CHAR, source, tag, comm, &status);
618}

◆ sendRecv() [3/9]

template<>
void olb::singleton::MpiManager::sendRecv ( double * sendBuf,
double * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 669 of file mpiManager.cpp.

671{
672 if (!ok) {
673 return;
674 }
675 MPI_Status status;
676 MPI_Sendrecv(static_cast<void*>(sendBuf),
677 count,
678 MPI_DOUBLE, dest, tag,
679 static_cast<void*>(recvBuf),
680 count,
681 MPI_DOUBLE, source, tag, comm, &status);
682}

◆ sendRecv() [4/9]

template<>
void olb::singleton::MpiManager::sendRecv ( float * sendBuf,
float * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 637 of file mpiManager.cpp.

639{
640 if (!ok) {
641 return;
642 }
643 MPI_Status status;
644 MPI_Sendrecv(static_cast<void*>(sendBuf),
645 count,
646 MPI_FLOAT, dest, tag,
647 static_cast<void*>(recvBuf),
648 count,
649 MPI_FLOAT, source, tag, comm, &status);
650}

◆ sendRecv() [5/9]

template<>
void olb::singleton::MpiManager::sendRecv ( int * sendBuf,
int * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 621 of file mpiManager.cpp.

623{
624 if (!ok) {
625 return;
626 }
627 MPI_Status status;
628 MPI_Sendrecv(static_cast<void*>(sendBuf),
629 count,
630 MPI_INT, dest, tag,
631 static_cast<void*>(recvBuf),
632 count,
633 MPI_INT, source, tag, comm, &status);
634}

◆ sendRecv() [6/9]

template<>
void olb::singleton::MpiManager::sendRecv ( long * sendBuf,
long * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 653 of file mpiManager.cpp.

655{
656 if (!ok) {
657 return;
658 }
659 MPI_Status status;
660 MPI_Sendrecv(static_cast<void*>(sendBuf),
661 count,
662 MPI_LONG, dest, tag,
663 static_cast<void*>(recvBuf),
664 count,
665 MPI_LONG, source, tag, comm, &status);
666}

◆ sendRecv() [7/9]

template<>
void olb::singleton::MpiManager::sendRecv ( long double * sendBuf,
long double * recvBuf,
int count,
int dest,
int source,
int tag,
MPI_Comm comm )

Definition at line 685 of file mpiManager.cpp.

687{
688 if (!ok) {
689 return;
690 }
691 MPI_Status status;
692 MPI_Sendrecv(static_cast<void*>(sendBuf),
693 count,
694 MPI_LONG_DOUBLE, dest, tag,
695 static_cast<void*>(recvBuf),
696 count,
697 MPI_LONG_DOUBLE, source, tag, comm, &status);
698}

◆ sendRecv() [8/9]

template<typename T >
void olb::singleton::MpiManager::sendRecv ( T * sendBuf,
T * recvBuf,
int count,
int dest,
int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Send and receive data between two partners.

+ Here is the caller graph for this function:

◆ sendRecv() [9/9]

template<typename T , unsigned DIM>
void olb::singleton::MpiManager::sendRecv ( util::ADf< T, DIM > * sendBuf,
util::ADf< T, DIM > * recvBuf,
int count,
int dest,
int source,
int tag = 0,
MPI_Comm comm = MPI_COMM_WORLD )

Definition at line 106 of file mpiManagerAD.hh.

107{
108 if (!ok) {
109 return;
110 }
111 MPI_Status status;
112 MPI_Sendrecv(static_cast<void*>(sendBuf),
113 (sizeof(util::ADf<T,DIM>)/8)*count,
114 MPI_DOUBLE, dest, tag,
115 static_cast<void*>(recvBuf),
116 (sizeof(util::ADf<T,DIM>)/8)*count,
117 MPI_DOUBLE, source, tag, comm, &status);
118}

◆ sendToMaster() [1/6]

template<>
void olb::singleton::MpiManager::sendToMaster ( bool * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 455 of file mpiManager.cpp.

456{
457 if (!ok) {
458 return;
459 }
460 if (iAmRoot && !isMainProcessor()) {
461 send(sendBuf, sendCount, 0);
462 }
463 if (isMainProcessor() && !iAmRoot) {
464 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
465 }
466}

References isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ sendToMaster() [2/6]

template<>
void olb::singleton::MpiManager::sendToMaster ( char * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 469 of file mpiManager.cpp.

470{
471 if (!ok) {
472 return;
473 }
474 if (iAmRoot && !isMainProcessor()) {
475 send(sendBuf, sendCount, 0);
476 }
477 if (isMainProcessor() && !iAmRoot) {
478 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
479 }
480}

References isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ sendToMaster() [3/6]

template<>
void olb::singleton::MpiManager::sendToMaster ( double * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 511 of file mpiManager.cpp.

512{
513 if (!ok) {
514 return;
515 }
516 if (iAmRoot && !isMainProcessor()) {
517 send(sendBuf, sendCount, 0);
518 }
519 if (isMainProcessor() && !iAmRoot) {
520 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
521 }
522}

References isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ sendToMaster() [4/6]

template<>
void olb::singleton::MpiManager::sendToMaster ( float * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 497 of file mpiManager.cpp.

498{
499 if (!ok) {
500 return;
501 }
502 if (iAmRoot && !isMainProcessor()) {
503 send(sendBuf, sendCount, 0);
504 }
505 if (isMainProcessor() && !iAmRoot) {
506 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
507 }
508}

References isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ sendToMaster() [5/6]

template<>
void olb::singleton::MpiManager::sendToMaster ( int * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm )

Definition at line 483 of file mpiManager.cpp.

484{
485 if (!ok) {
486 return;
487 }
488 if (iAmRoot && !isMainProcessor()) {
489 send(sendBuf, sendCount, 0);
490 }
491 if (isMainProcessor() && !iAmRoot) {
492 receive(sendBuf, sendCount, MPI_ANY_SOURCE);
493 }
494}

References isMainProcessor(), receive(), and send().

+ Here is the call graph for this function:

◆ sendToMaster() [6/6]

template<typename T >
void olb::singleton::MpiManager::sendToMaster ( T * sendBuf,
int sendCount,
bool iAmRoot,
MPI_Comm comm = MPI_COMM_WORLD )

Sends data to master processor.

+ Here is the caller graph for this function:

◆ synchronizeIO()

void olb::singleton::MpiManager::synchronizeIO ( unsigned tDelay = 100,
MPI_Comm comm = MPI_COMM_WORLD )

Synchronizes the processes and wait to ensure correct cout order.

Definition at line 101 of file mpiManager.cpp.

102{
103 usleep(tDelay);
104 barrier(comm);
105}
void barrier(MPI_Comm comm=MPI_COMM_WORLD)
Synchronizes the processes.

References barrier().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wait()

void olb::singleton::MpiManager::wait ( MPI_Request * request,
MPI_Status * status )

Complete a non-blocking MPI operation.

Definition at line 1726 of file mpiManager.cpp.

1727{
1728 if (!ok) {
1729 return;
1730 }
1731 MPI_Wait(request, status);
1732}

◆ waitAll()

void olb::singleton::MpiManager::waitAll ( MpiNonBlockingHelper & mpiNbHelper)

Complete a series of non-blocking MPI operations.

Definition at line 1734 of file mpiManager.cpp.

1735{
1736 if (!ok || mpiNbHelper.get_size() == 0) {
1737 return;
1738 }
1739 MPI_Waitall(mpiNbHelper.get_size(), mpiNbHelper.get_mpiRequest(), mpiNbHelper.get_mpiStatus());
1740}

References olb::singleton::MpiNonBlockingHelper::get_mpiRequest(), olb::singleton::MpiNonBlockingHelper::get_mpiStatus(), and olb::singleton::MpiNonBlockingHelper::get_size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ mpi

MpiManager & mpi ( )
friend

Definition at line 29 of file mpiManager.cpp.

30{
31 static MpiManager instance;
32 return instance;
33}

The documentation for this class was generated from the following files: