MADNESS 0.10.1
|
A collection of processes. More...
#include <group.h>
Classes | |
class | Impl |
Public Member Functions | |
Group () | |
Default constructor. | |
Group (const Group &other) | |
Copy constructor. | |
template<typename A > | |
Group (World &world, const A &group, const DistributedID &did) | |
Create a new group. | |
template<typename A > | |
Group (World &world, const A &group, const std::size_t tag) | |
Create a new group. | |
template<typename A > | |
Group (World &world, const A &group, const uniqueidT &uid, const std::size_t tag) | |
Create a new group. | |
bool | empty () const |
Quary empty group. | |
World & | get_world () const |
Parent world accessor. | |
const DistributedID & | id () const |
Group id accessor. | |
void | local_update () const |
Update local usage count. | |
void | make_tree (const ProcessID group_root, ProcessID &parent, ProcessID &child1, ProcessID &child2) const |
Compute the binary tree parents and children. | |
Group & | operator= (const Group &other) |
Copy assignment operator. | |
ProcessID | rank () const |
Group rank accessor. | |
ProcessID | rank (const ProcessID world_rank) const |
Map world rank to group rank. | |
void | remote_update () const |
Update remote usage count. | |
template<typename Archive > | |
void | serialize (const Archive &) |
ProcessID | size () const |
Group size accessor. | |
ProcessID | world_rank (const ProcessID group_rank) const |
Map group rank to world rank. | |
Static Public Member Functions | |
static madness::Future< Group > | get_group (const DistributedID &did) |
Get group from the registry. | |
Private Member Functions | |
Group (Impl *pimpl) | |
void | register_group () const |
Add this group to the registry. | |
Static Private Member Functions | |
static void | unregister_group (const DistributedID &did) |
Remove this group from the registry. | |
Private Attributes | |
std::shared_ptr< Impl > | pimpl_ |
A collection of processes.
Group
is a light weight object that can be used to specify a set of processes that will participate in Gop collective operations. The advantage of Group over MPI (or SafeMPI) groups is that it eliminates the need to construct new communicator and the associated barrier.
|
inlineprivate |
|
inline |
|
inline |
Copy constructor.
other | The group to be copied |
|
inline |
Create a new group.
A | An array type |
world | The parent world for this group |
group | An array with a list of process to be included in the |
did | The distributed id associated with this group |
group
list must be included in the parent world. References register_group().
|
inline |
Create a new group.
A | An array type |
world | The parent world for this group |
group | An array with a list of process to be included in the |
tag | The tag associated with this group group. |
group
list must be included in the parent world. References register_group().
|
inline |
Create a new group.
A | An array type |
world | The parent world for this group |
group | An array with a list of process to be included in the |
uid | The unique id (used by WorldObject ) associated with this group |
tag | The tag associated with this group group. |
group
list must be included in the parent world. References register_group().
|
inline |
Quary empty group.
true
when this group is empty References pimpl_.
Referenced by madness::WorldGopInterface::all_reduce(), madness::WorldGopInterface::bcast(), madness::WorldGopInterface::lazy_sync(), and madness::WorldGopInterface::reduce().
|
static |
Get group from the registry.
Get a registered group.
This function is used to acquire the group in an active message handler.
did | The id associated with the group |
Referenced by madness::WorldGopInterface::group_bcast_handler().
|
inline |
Parent world accessor.
References MADNESS_ASSERT, and pimpl_.
Referenced by madness::WorldGopInterface::all_reduce(), madness::WorldGopInterface::bcast(), madness::WorldGopInterface::lazy_sync(), and madness::WorldGopInterface::reduce().
|
inline |
Group id accessor.
References MADNESS_ASSERT, and pimpl_.
Referenced by madness::WorldGopInterface::group_bcast_task().
|
inline |
Update local usage count.
Calling this function indicates that this group will be used by a task function that was spawned by a remote process. For each call to this function, remote_update
must be called exactly once.
WorldGopInterface
will call this function as needed. Users may call this function if a Group
is used in user provided collective operations. References MADNESS_ASSERT, and pimpl_.
Referenced by madness::WorldGopInterface::bcast_internal().
|
inline |
Compute the binary tree parents and children.
[in] | group_root | The head node of the binary tree in the group |
[out] | parent | The parent node of the binary tree |
[out] | child1 | The left child node of the binary tree |
[out] | child2 | The right child node of the binary tree |
References MADNESS_ASSERT, and pimpl_.
Referenced by madness::WorldGopInterface::all_reduce(), madness::WorldGopInterface::group_bcast_task(), madness::WorldGopInterface::lazy_sync(), and madness::WorldGopInterface::reduce().
Copy assignment operator.
other | The group to be copied |
References pimpl_.
|
inline |
Group rank accessor.
References MADNESS_ASSERT, and pimpl_.
Referenced by madness::WorldGopInterface::all_reduce(), madness::WorldGopInterface::bcast(), and madness::WorldGopInterface::bcast_internal().
Map world rank to group rank.
world_rank | The world rank to be mapped |
world_rank
process in the group References MADNESS_ASSERT, pimpl_, and world_rank().
|
private |
Add this group to the registry.
Register a group.
Register a group so that it can be used in active messages and tasks spawned on remote nodes.
TiledArray::Exception | When the group is empty |
TiledArray::Exception | When the group is already in the registry |
Register a group so that it can be used in active messages and tasks spawned on remote nodes.
group | The group to be registered |
TiledArray::Exception | When the group is empty |
TiledArray::Exception | When the group is already in the registry |
|
inline |
Update remote usage count.
Calling this function indicates that this group has been used by a task function that was spawned by a remote process. For each call to this function, remote_update
must be called exactly once.
WorldGopInterface
will call this function as needed. Users may call this function if a Group
is used in user provided collective operations. References MADNESS_ASSERT, and pimpl_.
Referenced by madness::WorldGopInterface::group_bcast_task().
|
inline |
References MADNESS_ASSERT.
|
inline |
Group size accessor.
References pimpl_.
Referenced by madness::WorldGopInterface::all_reduce(), madness::WorldGopInterface::bcast(), madness::WorldGopInterface::lazy_sync(), and madness::WorldGopInterface::reduce().
|
staticprivate |
Remove this group from the registry.
Remove the given group from the registry.
Groups are removed via a lazy sync operation, which will only remove the group from the registry once unregister_group()
has been called on all processes in the group.
Groups are removed via a lazy sync operation, which will only remove the group from the registry once unregistered has been called on all processes in the group.
group | The group to be removed from the registry |
References MADNESS_ASSERT.
Referenced by madness::Group::Impl::remote_update().
Map group rank to world rank.
group_rank | The group rank to be mapped to a world rank |
References MADNESS_ASSERT, and pimpl_.
Referenced by rank().
|
private |
Referenced by empty(), get_world(), id(), local_update(), make_tree(), operator=(), rank(), rank(), register_group(), remote_update(), size(), and world_rank().