MADNESS
0.10.1
|
Wrapper around MPI_Comm. Has a shallow copy constructor; use Create(Get_group()) for deep copy. More...
#include <safempi.h>
Classes | |
struct | Impl |
struct | WorldInitObject |
Public Member Functions | |
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. More... | |
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 | Isend (const void *buf, const int count, const MPI_Datatype datatype, const int dest, const int tag) const |
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) More... | |
int | unique_tag () |
Returns a unique tag for temporary use (1023<tag<4095) More... | |
Static Public Member Functions | |
static int | unique_tag_period () |
Static Public Attributes | |
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 |
Private Member Functions | |
Intracomm () | |
Intracomm (const std::shared_ptr< Impl > &i) | |
Intracomm & | operator= (const Intracomm &other) |
Static Private Member Functions | |
static bool | Comm_compare (const MPI_Comm &comm1, const MPI_Comm &comm2) |
Private Attributes | |
std::shared_ptr< Impl > | pimpl |
Friends | |
int | Finalize () |
Analogous to MPI_Finalize. More... | |
void | SafeMPI::detail::init_comm_world () |
Wrapper around MPI_Comm. Has a shallow copy constructor; use Create(Get_group()) for deep copy.
|
inlineprivate |
|
inlineprivate |
Referenced by Create(), Split(), and Split_type().
SafeMPI::Intracomm::Intracomm | ( | const WorldInitObject & | init | ) |
|
inlineexplicit |
References Comm_compare(), SafeMPI::Is_initialized(), MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Comm_rank(), MPI_Comm_size(), MPI_COMM_WORLD, and pimpl.
|
inline |
|
inline |
|
inline |
References MPI_Abort(), and pimpl.
Referenced by madness::error().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Allreduce(), op(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Barrier(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::World::World().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Bcast(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::WorldMpiInterface::Bcast().
void SafeMPI::Intracomm::binary_tree_info | ( | int | root, |
int & | parent, | ||
int & | child0, | ||
int & | child1 | ||
) |
Construct info about a binary tree with given root.
Constructs a binary tree spanning the communicator with process root as the root of the tree. Returns the logical parent and children in the tree of the calling process. If there is no parent/child the value -1 will be set.
References Get_rank(), Get_size(), me, and np.
Referenced by madness::WorldGopInterface::all_reduce(), madness::WorldGopInterface::bcast_task(), madness::WorldGopInterface::broadcast(), madness::WorldGopInterface::concat0(), madness::WorldGopInterface::fence_impl(), madness::WorldGopInterface::lazy_sync(), and madness::WorldGopInterface::reduce().
|
inline |
Clones this Intracomm object
References Create(), and Get_group().
|
inlinestaticprivate |
References MPI_Comm_compare(), MPI_IDENT, and MPI_SUCCESS.
Referenced by Intracomm(), SafeMPI::Intracomm::Impl::~Impl(), and operator==().
This collective operation creates a new Intracomm
from an Intracomm::Group
object. Must be called by all processes that belong to this communicator, but not all must use the same group
. Thus this Intracomm
can be partitioned into several Intracomm
objects with one call.
group | Intracomm::Group describing the Intracomm object to be created (Intracomm::Get_group() and Intracomm::Group::Incl() ) |
References Intracomm(), SafeMPI::Group::group(), MADNESS_ASSERT, MADNESS_MPI_TEST, me, MPI_Comm_create(), MPI_Comm_rank(), MPI_Comm_size(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by Clone(), and test_multi_world().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Comm_get_attr(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
|
inline |
This local operation returns the Intracomm::Group object corresponding to this intracommunicator
References MADNESS_ASSERT, pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::WorldAmInterface::WorldAmInterface(), Clone(), and test_multi_world().
|
inline |
|
inline |
References MADNESS_ASSERT, and pimpl.
Referenced by madness::RMI::assert_aslr_off(), madness::ThreadPool::begin(), binary_tree_info(), madness::WorldGopInterface::initial_max_reducebcast_msg_size(), madness::detail::WorldMpi::initialize(), main(), madness::WorldMpiInterface::rank(), and madness::profiling::TaskProfiler::write_to_file().
|
inline |
References MADNESS_ASSERT, and pimpl.
Referenced by madness::ThreadPool::ThreadPool(), binary_tree_info(), madness::WorldMpiInterface::nproc(), madness::WorldMpiInterface::size(), and test_multi_world().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Irecv(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::WorldMpiInterface::Irecv().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Isend(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::WorldMpiInterface::Isend().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Issend(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
|
inline |
References Comm_compare(), and pimpl.
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Recv(), MPI_STATUS_IGNORE, pimpl, SAFE_MPI_GLOBAL_MUTEX, and source().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Recv(), pimpl, SAFE_MPI_GLOBAL_MUTEX, source(), and status.
Referenced by madness::WorldMpiInterface::Recv().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Reduce(), op(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::RMI::assert_aslr_off().
|
inline |
References MADNESS_ASSERT, MADNESS_MPI_TEST, MPI_Ssend(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::WorldMpiInterface::Send().
|
inline |
This collective operation creates a new Intracomm
using the MPI_Comm_split. Must be called by all processes that belong to this communicator. Each caller must provide Color of the new Intracomm and Key (this controls the rank within the new Intracomm; ties are broken by the rank in this Intracomm).
Color | Specifies the new Intracomm that the calling process is to be assigned to. The value of color must be non-negative. If Color=UNDEFINED_COLOR then an uninitialized Intracomm object will be produced. |
Key | The relative rank of the calling process in the group of the new Intracomm. If omitted, each communicator's ranks will be determined by the rank in the host communicator. |
References Intracomm(), MADNESS_ASSERT, MADNESS_MPI_TEST, me, MPI_COMM_NULL, MPI_Comm_rank(), MPI_Comm_size(), MPI_Comm_split(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by madness::MacroTaskQ::create_worlds(), and test_multi_world().
|
inline |
This collective operation creates a new Intracomm
using the MPI_Comm_split_type. Must be called by all processes that belong to this communicator. Each caller must provide the split type and Key (this controls the rank within the new Intracomm; ties are broken by the rank in this Intracomm).
Type | Controls how this Intracomm will be split. The value can only be UNDEFINED_SPLIT_TYPE or SHARED_SPLIT_TYPE. If Type=UNDEFINED_SPLIT_TYPE then an uninitialized Intracomm object will be produced. |
Key | The relative rank of the calling process in the group of the new Intracomm. If omitted, each communicator's ranks will be determined by the rank in the host communicator. |
References Intracomm(), MADNESS_ASSERT, MADNESS_MPI_TEST, me, MPI_COMM_NULL, MPI_Comm_rank(), MPI_Comm_size(), MPI_Comm_split_type(), MPI_Info_create(), MPI_Info_free(), pimpl, and SAFE_MPI_GLOBAL_MUTEX.
Referenced by test_multi_world().
|
inline |
Returns a unique tag reserved for long-term use (0<tag<1000)
Get a tag from this routine for long-term/repeated use.
Tags in [1000,1023] are statically assigned.
References MADNESS_ASSERT, and pimpl.
|
inline |
Returns a unique tag for temporary use (1023<tag<4095)
These tags are intended for one time use to avoid tag collisions with other messages around the same time period. It simply increments/wraps a counter and returns the next legal value.
So that send and receiver agree on the tag all processes need to call this routine in the same sequence.
References MADNESS_ASSERT, and pimpl.
Referenced by madness::WorldGopInterface::broadcast(), madness::WorldGopInterface::concat0(), madness::WorldGopInterface::fence_impl(), madness::WorldGopInterface::reduce(), and madness::archive::ArchiveStoreImpl< ParallelOutputArchive< localarchiveT >, WorldContainer< keyT, valueT > >::store().
|
inlinestatic |
References SafeMPI::Intracomm::Impl::unique_tag_period().
Referenced by madness::WorldGopInterface::concat0().
|
friend |
Analogous to MPI_Finalize.
This returns status rather than throw an exception upon failure because this is a "destructor", and throwing from destructors is evil.
|
friend |
|
private |
Referenced by Intracomm(), Abort(), Allreduce(), Barrier(), Bcast(), Create(), Get_attr(), Get_group(), Get_mpi_comm(), Get_rank(), Get_size(), SafeMPI::detail::init_comm_world(), Irecv(), Isend(), Issend(), operator==(), Recv(), Reduce(), Send(), Split(), Split_type(), unique_reserved_tag(), and unique_tag().
|
static |
Referenced by test_multi_world().
|
static |
|
static |