MADNESS  version 0.9
Public Member Functions | List of all members
madness::WorldMpiInterface Class Reference

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

#include <worldmpi.h>

Inheritance diagram for madness::WorldMpiInterface:
Inheritance graph
[legend]
Collaboration diagram for madness::WorldMpiInterface:
Collaboration graph
[legend]

Public Member Functions

 WorldMpiInterface (const SafeMPI::Intracomm &comm)
 
 ~WorldMpiInterface ()
 
SafeMPI::Intracommcomm ()
 Returns the associated SafeMPI communicator. More...
 
template<typename T >
madness::disable_if
< std::is_pointer< T >
, SafeMPI::Request >::type 
Isend (const T &datum, int dest, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Isend one element ... disabled for pointers to reduce accidental misuse. More...
 
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 lenbuf elements from process dest. More...
 
template<typename T >
madness::disable_if
< std::is_pointer< T >
, SafeMPI::Request >::type 
Irecv (T &buf, int source, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Async receive datum from process dest with default tag=1. More...
 
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. More...
 
template<typename T >
madness::disable_if
< std::is_pointer< T >, 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. More...
 
template<typename T >
void Recv (T *buf, long lenbuf, int src, int tag) const
 Receive data of up to lenbuf elements from process dest. More...
 
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. More...
 
template<typename T >
madness::disable_if
< std::is_pointer< T >, void >
::type 
Recv (T &buf, int src, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
 Receive datum from process src. More...
 
template<typename T >
void Bcast (T *buffer, int count, int root) const
 MPI broadcast an array of count elements. More...
 
template<typename T >
madness::disable_if
< std::is_pointer< T >, void >
::type 
Bcast (T &buffer, int root) const
 MPI broadcast a datum. More...
 
int rank () const
 
int nproc () const
 
int size () const
 
- Public Member Functions inherited from SafeMPI::Intracomm
 Intracomm (const WorldInitObject &)
 
 Intracomm (const MPI_Comm &comm, bool take_ownership_of_comm=true)
 
 Intracomm (const Intracomm &other)
 
 ~Intracomm ()
 
Intracomm Create (Group group) const
 
bool operator== (const Intracomm &other) const
 
Group Get_group () const
 
MPI_CommGet_mpi_comm () const
 
int Get_rank () const
 
int Get_size () const
 
Request Isend (const void *buf, const int count, const MPI_Datatype datatype, const int dest, const int tag) const
 
Request Irecv (void *buf, const int count, const MPI_Datatype datatype, const int src, const int tag) const
 
void Send (const void *buf, const int count, const MPI_Datatype datatype, int dest, 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 Recv (void *buf, const int count, const MPI_Datatype datatype, const int source, const int tag) const
 
void Bcast (void *buf, size_t count, const MPI_Datatype datatype, const int root) const
 
void Reduce (const void *sendbuf, void *recvbuf, const int count, const MPI_Datatype datatype, const MPI_Op op, const int root) const
 
void Allreduce (const void *sendbuf, void *recvbuf, const int count, const MPI_Datatype datatype, const MPI_Op op) const
 
bool Get_attr (int key, void *value) const
 
void Abort (int code=1) const
 
void Barrier () const
 
int unique_tag ()
 Returns a unique tag for temporary use (1023<tag<=4095) More...
 
int unique_reserved_tag ()
 Returns a unique tag reserved for long-term use (0<tag<1000) More...
 
void binary_tree_info (int root, int &parent, int &child0, int &child1)
 Construct info about a binary tree with given root. More...
 

Detailed Description

This class wraps/extends the MPI interface for World.

Constructor & Destructor Documentation

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

Member Function Documentation

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

MPI broadcast an array of count elements.

NB. Read documentation about interaction of MPI collectives and AM/task handling.

References SafeMPI::Intracomm::Bcast(), MPI_BYTE, and std::tr1::T().

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

MPI broadcast a datum.

NB. Read documentation about interaction of MPI collectives and AM/task handling.

References SafeMPI::Intracomm::Bcast(), MPI_BYTE, and std::tr1::T().

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

Returns the associated SafeMPI communicator.

Referenced by madness::WorldAmInterface::WorldAmInterface().

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 lenbuf elements from process dest.

References SafeMPI::Intracomm::Irecv(), MPI_BYTE, and std::tr1::T().

Referenced by madness::WorldGopInterface::broadcast(), and madness::WorldGopInterface::fence().

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

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

References SafeMPI::Intracomm::Irecv(), MPI_BYTE, and std::tr1::T().

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

Isend one element ... disabled for pointers to reduce accidental misuse.

References SafeMPI::Intracomm::Isend(), MPI_BYTE, and std::tr1::T().

Referenced by madness::WorldGopInterface::broadcast(), and madness::WorldGopInterface::fence().

int madness::WorldMpiInterface::nproc ( ) const
inline
int madness::WorldMpiInterface::rank ( ) const
inline
template<typename T >
void madness::WorldMpiInterface::Recv ( T *  buf,
long  lenbuf,
int  src,
int  tag 
) const
inline
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.

References MPI_BYTE, SafeMPI::Intracomm::Recv(), and std::tr1::T().

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

Receive datum from process src.

References MPI_BYTE, SafeMPI::Intracomm::Recv(), and std::tr1::T().

template<class T >
void madness::WorldMpiInterface::Send ( const T *  buf,
long  lenbuf,
int  dest,
int  tag = SafeMPI::DEFAULT_SEND_RECV_TAG 
) const
inline
template<typename T >
madness::disable_if<std::is_pointer<T>, 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.

Disabled for pointers to reduce accidental misuse.

References MPI_BYTE, SafeMPI::Intracomm::Send(), and std::tr1::T().

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

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