ug4
|
communicator for simultaneous data exchange between many small groups More...
#include <pcl_multi_group_communicator.h>
Public Member Functions | |
template<typename T > | |
void | allreduce (const T *sendBuf, T *recvBuf, size_t countPerGroup, ReduceOperation op) const |
performs an allreduce between all groups More... | |
size_t | membership_group_index (size_t imem) const |
MultiGroupCommunicator (const std::vector< bool > &participates, ProcessCommunicator com=ProcessCommunicator()) | |
MultiGroupCommunicator (ProcessCommunicator com=ProcessCommunicator()) | |
size_t | num_groups () const |
size_t | num_memberships () const |
bool | participates (size_t igrp) const |
void | reinit (const std::vector< bool > &participates) |
Private Attributes | |
std::map< int, ug::BinaryBuffer > | m_binBufs |
used for sending/receiving data from/to processes More... | |
ProcessCommunicator | m_com |
std::vector< int > | m_groupMembers |
size: m_groupOffsets.back(). Consecutively holds proc-indices of each group in which the process participates. More... | |
std::vector< size_t > | m_groupOffsets |
size: #memberships+1. Offset of each group in m_groupMembers. The last entry always holds m_groupMembers.size(). More... | |
std::vector< size_t > | m_memberships |
size: #memberships. Holds indices to groups in which the process participates More... | |
std::vector< bool > | m_participates |
size: #groups More... | |
communicator for simultaneous data exchange between many small groups
The MultiGroupCommunicator allows for a process to be member in various small groups and to perform collective operations on those groups.
pcl::MultiGroupCommunicator::MultiGroupCommunicator | ( | ProcessCommunicator | com = ProcessCommunicator() | ) |
pcl::MultiGroupCommunicator::MultiGroupCommunicator | ( | const std::vector< bool > & | participates, |
ProcessCommunicator | com = ProcessCommunicator() |
||
) |
References participates(), and reinit().
void pcl::MultiGroupCommunicator::allreduce | ( | const T * | sendBuf, |
T * | recvBuf, | ||
size_t | countPerGroup, | ||
ReduceOperation | op | ||
) | const |
performs an allreduce between all groups
sendBuf and recvBuf have to be of length 'countPerGroup' * num_memberships()
References pcl::ProcessCommunicator::get_local_proc_id(), pcl::ProcessCommunicator::get_mpi_communicator(), pcl::ProcessCommunicator::get_proc_id(), m_com, m_groupMembers, m_groupOffsets, m_memberships, s, UG_COND_THROW, and pcl::Waitall().
size_t pcl::MultiGroupCommunicator::membership_group_index | ( | size_t | imem | ) | const |
References m_memberships.
size_t pcl::MultiGroupCommunicator::num_groups | ( | ) | const |
References m_participates.
size_t pcl::MultiGroupCommunicator::num_memberships | ( | ) | const |
References m_memberships.
bool pcl::MultiGroupCommunicator::participates | ( | size_t | igrp | ) | const |
References m_participates.
Referenced by MultiGroupCommunicator(), and reinit().
void pcl::MultiGroupCommunicator::reinit | ( | const std::vector< bool > & | participates | ) |
References pcl::ProcessCommunicator::allgatherv(), m_com, m_groupMembers, m_groupOffsets, m_memberships, m_participates, participates(), s, and pcl::ProcessCommunicator::size().
Referenced by MultiGroupCommunicator().
|
private |
used for sending/receiving data from/to processes
|
private |
Referenced by allreduce(), and reinit().
|
private |
size: m_groupOffsets.back(). Consecutively holds proc-indices of each group in which the process participates.
Referenced by allreduce(), and reinit().
|
private |
size: #memberships+1. Offset of each group in m_groupMembers. The last entry always holds m_groupMembers.size().
Referenced by allreduce(), and reinit().
|
private |
size: #memberships. Holds indices to groups in which the process participates
Referenced by allreduce(), membership_group_index(), num_memberships(), and reinit().
|
private |
size: #groups
Referenced by num_groups(), participates(), and reinit().