MADNESS 0.10.1
madness::WorldMpiInterface Class Reference

This class wraps/extends the MPI interface for World. More...

#include <worldmpi.h>

Inheritance diagram for madness::WorldMpiInterface:
Collaboration diagram for madness::WorldMpiInterface:

Public Member Functions

 WorldMpiInterface (const SafeMPI::Intracomm &comm)
 Constructs an interface in the specified SafeMPI communicator.
 ~WorldMpiInterface ()=default
template<typename T>
std::enable_if<!std::is_pointer< T >::value, void >::type Bcast (T &buffer, int root) const
 MPI broadcast a datum.
template<typename T>
void Bcast (T *buffer, int count, int root) const
 MPI broadcast an array of count elements.
void Bcast (void *buf, size_t count, const MPI_Datatype datatype, const int root) const
SafeMPI::Intracomm & comm ()
 Returns the associated SafeMPI communicator.
template<typename T>
std::enable_if<!std::is_pointer< T >::value, SafeMPI::Request >::type Irecv (T &buf, int source, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Async receive datum from process source with default tag=1.
template<typename T>
SafeMPI::Request Irecv (T *buf, int count, int source, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Async receive data of up to count elements from process source.
Request Irecv (void *buf, const int count, const MPI_Datatype datatype, const int src, const int tag) const
template<typename T>
std::enable_if<!std::is_pointer< T >::value, SafeMPI::Request >::type Isend (const T &datum, int dest, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Isend one element.
Request Isend (const void *buf, const int count, const MPI_Datatype datatype, const int dest, const int tag) const
int nproc () const
 Access the total number of processes.
int rank () const
 Access the rank of this process.
template<typename T>
std::enable_if<!std::is_pointer< T >::value, void >::type Recv (T &buf, int src, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Receive datum from process src.
template<typename T>
void Recv (T *buf, long lenbuf, int src, int tag) const
 Receive data of up to lenbuf elements from process src.
template<typename T>
void Recv (T *buf, long lenbuf, int src, int tag, SafeMPI::Status &status) const
 Receive data of up to lenbuf elements from process dest with status.
void Recv (void *buf, const int count, const MPI_Datatype datatype, const int source, const int tag) const
void Recv (void *buf, const int count, const MPI_Datatype datatype, const int source, const int tag, MPI_Status &status) const
template<typename T>
std::enable_if<!std::is_pointer< T >::value, void >::type Send (const T &datum, int dest, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Send element to process dest with default tag=1001.
template<class T>
void Send (const T *buf, long lenbuf, int dest, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Send array of lenbuf elements to process dest.
void Send (const void *buf, const int count, const MPI_Datatype datatype, int dest, int tag) const
int size () const
 Access the total number of processes.
Public Member Functions inherited from SafeMPI::Intracomm
 Intracomm (const Intracomm &other)
 Intracomm (const MPI_Comm &comm, bool take_ownership_of_comm=true)
 Intracomm (const WorldInitObject &)
 ~Intracomm ()
void Abort (int code=1) const
void Allreduce (const void *sendbuf, void *recvbuf, const int count, const MPI_Datatype datatype, const MPI_Op op) const
void Barrier () const
void Bcast (void *buf, size_t count, const MPI_Datatype datatype, const int root) const
void binary_tree_info (int root, int &parent, int &child0, int &child1)
 Construct info about a binary tree with given root.
Intracomm Clone () const
Intracomm Create (Group group) const
bool Get_attr (int key, void *value) const
Group Get_group () const
MPI_Comm & Get_mpi_comm () const
int Get_rank () const
int Get_size () const
Request Irecv (void *buf, const int count, const MPI_Datatype datatype, const int src, const int tag) const
Request Irecv_bytes (void *buf, const std::size_t nbyte, const int src, const int tag) const
 Nonblocking receive of nbyte bytes; unlike Irecv() , nbyte may exceed INT_MAX.
Request Isend (const void *buf, const int count, const MPI_Datatype datatype, const int dest, const int tag) const
Request Isend_bytes (const void *buf, const std::size_t nbyte, const int dest, const int tag, const bool sync=false) const
 Nonblocking send of nbyte bytes; unlike Isend() , nbyte may exceed INT_MAX.
Request Issend (const void *buf, const int count, const MPI_Datatype datatype, const int dest, const int tag) const
bool operator== (const Intracomm &other) const
void Recv (void *buf, const int count, const MPI_Datatype datatype, const int source, const int tag) const
void Recv (void *buf, const int count, const MPI_Datatype datatype, const int source, const int tag, MPI_Status &status) const
void Reduce (const void *sendbuf, void *recvbuf, const int count, const MPI_Datatype datatype, const MPI_Op op, const int root) const
void Send (const void *buf, const int count, const MPI_Datatype datatype, int dest, int tag) const
Intracomm Split (int Color, int Key=0) const
Intracomm Split_type (int Type, int Key=0) const
int unique_reserved_tag ()
 Returns a unique tag reserved for long-term use (0<tag<1000).
int unique_tag ()
 Returns a unique tag for temporary use (1023<tag<4095).

Private Member Functions

 WorldMpiInterface (const WorldMpiInterface &)=delete
WorldMpiInterface & operator= (const WorldMpiInterface &)=delete
Private Member Functions inherited from madness::detail::WorldMpiRuntime
 WorldMpiRuntime ()
 Constructor.
 ~WorldMpiRuntime ()
 Destructor.

Additional Inherited Members

Static Public Member Functions inherited from SafeMPI::Intracomm
static int unique_tag_period ()
Static Public Attributes inherited from SafeMPI::Intracomm
static const int SHARED_SPLIT_TYPE = MPI_COMM_TYPE_SHARED
static const int UNDEFINED_COLOR = MPI_UNDEFINED
static const int UNDEFINED_SPLIT_TYPE = MPI_UNDEFINED

Detailed Description

This class wraps/extends the MPI interface for World.

Constructor & Destructor Documentation

◆ WorldMpiInterface() [1/2]

madness::WorldMpiInterface::WorldMpiInterface ( const WorldMpiInterface & )
privatedelete

References WorldMpiInterface().

Referenced by WorldMpiInterface(), and operator=().

◆ WorldMpiInterface() [2/2]

madness::WorldMpiInterface::WorldMpiInterface ( const SafeMPI::Intracomm & comm)
inline

Constructs an interface in the specified SafeMPI communicator.

Todo
Verify this documentation.
Parameters
[in]commThe communicator.

References SafeMPI::Intracomm::Intracomm(), madness::detail::WorldMpiRuntime::WorldMpiRuntime(), and comm().

◆ ~WorldMpiInterface()

madness::WorldMpiInterface::~WorldMpiInterface ( )
default

Member Function Documentation

◆ Bcast() [1/3]

template<typename T>
std::enable_if<!std::is_pointer< T >::value, void >::type madness::WorldMpiInterface::Bcast ( T & buffer,
int root ) const
inline

MPI broadcast a datum.

Note
Read documentation about interaction of MPI collectives and AM/task handling.
Template Parameters
TThe type of data to broadcast.
Parameters
[in,out]bufferThe datum to send (if this is the root process); otherwise, the received datum.
[in]rootThe process that is sending the data to other processes.

References SafeMPI::Intracomm::Bcast(), and MPI_BYTE.

◆ Bcast() [2/3]

template<typename T>
void madness::WorldMpiInterface::Bcast ( T * buffer,
int count,
int root ) const
inline

MPI broadcast an array of count elements.

Note
Read documentation about interaction of MPI collectives and AM/task handling.
Template Parameters
TThe type of data to broadcast.
Parameters
[in,out]bufferThe data to send (if this is the root process); otherwise, a buffer to receive the data.
[in]countThe number of data elements being broadcast.
[in]rootThe process that is sending the data to other processes.

References SafeMPI::Intracomm::Bcast(), and MPI_BYTE.

Referenced by madness::Cloud::replicate().

◆ Bcast() [3/3]

void SafeMPI::Intracomm::Bcast ( void * buf,
size_t count,
const MPI_Datatype datatype,
const int root ) const
inline

◆ comm()

SafeMPI::Intracomm & madness::WorldMpiInterface::comm ( )
inline

Returns the associated SafeMPI communicator.

Returns
The associated SafeMPI communicator.

Referenced by madness::WorldAmInterface::WorldAmInterface(), WorldMpiInterface(), create_worlds(), test_mpi_group(), and test_multi_world().

◆ Irecv() [1/3]

template<typename T>
std::enable_if<!std::is_pointer< T >::value, SafeMPI::Request >::type madness::WorldMpiInterface::Irecv ( T & buf,
int source,
int tag = SafeMPI::DEFAULT_SEND_RECV_TAG ) const
inline

Async receive datum from process source with default tag=1.

Template Parameters
TThe type of data to receive.
Parameters
[out]bufWhere to put the received datum.
[in]sourceThe source process.
[in]tagThe MPI tag.

References SafeMPI::DEFAULT_SEND_RECV_TAG, SafeMPI::Intracomm::Irecv(), MPI_BYTE, and source().

◆ Irecv() [2/3]

template<typename T>
SafeMPI::Request madness::WorldMpiInterface::Irecv ( T * buf,
int count,
int source,
int tag = SafeMPI::DEFAULT_SEND_RECV_TAG ) const
inline

Async receive data of up to count elements from process source.

Template Parameters
TThe type of data to receive.
Parameters
[out]bufWhere to put the received data.
[in]countThe number of data elements to receive.
[in]sourceThe source process.
[in]tagThe MPI tag.

References SafeMPI::DEFAULT_SEND_RECV_TAG, SafeMPI::Intracomm::Irecv(), MPI_BYTE, and source().

◆ Irecv() [3/3]

Request SafeMPI::Intracomm::Irecv ( void * buf,
const int count,
const MPI_Datatype datatype,
const int src,
const int tag ) const
inline

◆ Isend() [1/2]

template<typename T>
std::enable_if<!std::is_pointer< T >::value, SafeMPI::Request >::type madness::WorldMpiInterface::Isend ( const T & datum,
int dest,
int tag = SafeMPI::DEFAULT_SEND_RECV_TAG ) const
inline

Isend one element.

Note
Disabled for pointers to reduce accidental misuse.
Template Parameters
TThe type of data to send.
Parameters
[in]datumThe element to send.
[in]destThe destination process.
[in]tagThe MPI tag.

References SafeMPI::DEFAULT_SEND_RECV_TAG, SafeMPI::Intracomm::Isend(), and MPI_BYTE.

◆ Isend() [2/2]

Request SafeMPI::Intracomm::Isend ( const void * buf,
const int count,
const MPI_Datatype datatype,
const int dest,
const int tag ) const
inline

◆ nproc()

int madness::WorldMpiInterface::nproc ( ) const
inline

Access the total number of processes.

Returns
The number of processes.

References SafeMPI::Intracomm::Get_size().

◆ operator=()

WorldMpiInterface & madness::WorldMpiInterface::operator= ( const WorldMpiInterface & )
privatedelete

References WorldMpiInterface().

◆ rank()

int madness::WorldMpiInterface::rank ( ) const
inline

Access the rank of this process.

Returns
The rank of this process.

References SafeMPI::Intracomm::Get_rank().

Referenced by madness::redirectio().

◆ Recv() [1/5]

template<typename T>
std::enable_if<!std::is_pointer< T >::value, void >::type madness::WorldMpiInterface::Recv ( T & buf,
int src,
int tag = SafeMPI::DEFAULT_SEND_RECV_TAG ) const
inline

Receive datum from process src.

Template Parameters
TThe type of data to receive.
Parameters
[out]bufThe received datum.
[in]srcThe source process.
[in]tagThe MPI tag.

References SafeMPI::DEFAULT_SEND_RECV_TAG, MPI_BYTE, and SafeMPI::Intracomm::Recv().

◆ Recv() [2/5]

template<typename T>
void madness::WorldMpiInterface::Recv ( T * buf,
long lenbuf,
int src,
int tag ) const
inline

Receive data of up to lenbuf elements from process src.

Template Parameters
TThe type of data to receive.
Parameters
[out]bufWhere to put the received data.
[in]lenbufThe maximum number of data elements to receive.
[in]srcThe source process.
[in]tagThe MPI tag.

References MPI_BYTE, and SafeMPI::Intracomm::Recv().

Referenced by madness::archive::ArchiveStoreImpl< ParallelOutputArchive< localarchiveT >, WorldContainer< keyT, valueT > >::store(), and madness::archive::ArchiveStoreImpl< ParallelOutputArchive< VectorOutputArchive >, WorldContainer< keyT, valueT > >::store().

◆ Recv() [3/5]

template<typename T>
void madness::WorldMpiInterface::Recv ( T * buf,
long lenbuf,
int src,
int tag,
SafeMPI::Status & status ) const
inline

Receive data of up to lenbuf elements from process dest with status.

Template Parameters
TThe type of data to receive.
Parameters
[out]bufWhere to put the received data.
[in]lenbufThe maximum number of data elements to receive.
[in]srcThe source process.
[in]tagThe MPI tag.
[in]statusThe status.

References MPI_BYTE, SafeMPI::Intracomm::Recv(), and status.

◆ Recv() [4/5]

void SafeMPI::Intracomm::Recv ( void * buf,
const int count,
const MPI_Datatype datatype,
const int source,
const int tag ) const
inline

◆ Recv() [5/5]

void SafeMPI::Intracomm::Recv ( void * buf,
const int count,
const MPI_Datatype datatype,
const int source,
const int tag,
MPI_Status & status ) const
inline

◆ Send() [1/3]

template<typename T>
std::enable_if<!std::is_pointer< T >::value, void >::type madness::WorldMpiInterface::Send ( const T & datum,
int dest,
int tag = SafeMPI::DEFAULT_SEND_RECV_TAG ) const
inline

Send element to process dest with default tag=1001.

Note
Disabled for pointers to reduce accidental misuse.
Template Parameters
TThe type of data to send.
Parameters
[in]datumThe data element to send.
[in]destThe destination process.
[in]tagThe MPI tag.

References SafeMPI::DEFAULT_SEND_RECV_TAG, MPI_BYTE, and SafeMPI::Intracomm::Send().

◆ Send() [2/3]

template<class T>
void madness::WorldMpiInterface::Send ( const T * buf,
long lenbuf,
int dest,
int tag = SafeMPI::DEFAULT_SEND_RECV_TAG ) const
inline

Send array of lenbuf elements to process dest.

Template Parameters
TThe type of data to send.
Parameters
[in]bufPointer to the data.
[in]lenbufThe number of data elements to send.
[in]destThe destination process.
[in]tagThe MPI tag.

References SafeMPI::DEFAULT_SEND_RECV_TAG, MPI_BYTE, and SafeMPI::Intracomm::Send().

Referenced by madness::archive::ArchiveStoreImpl< ParallelOutputArchive< localarchiveT >, WorldContainer< keyT, valueT > >::store(), and madness::archive::ArchiveStoreImpl< ParallelOutputArchive< VectorOutputArchive >, WorldContainer< keyT, valueT > >::store().

◆ Send() [3/3]

void SafeMPI::Intracomm::Send ( const void * buf,
const int count,
const MPI_Datatype datatype,
int dest,
int tag ) const
inline

◆ size()

int madness::WorldMpiInterface::size ( ) const
inline

Access the total number of processes.

Returns
The number of processes.

References SafeMPI::Intracomm::Get_size().


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