MADNESS 0.10.1
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
madness::Group::Impl Class Reference
Collaboration diagram for madness::Group::Impl:
Collaboration graph
[legend]

Public Member Functions

template<typename A >
 Impl (World &world, const A &group, const DistributedID &did)
 Constructor.
 
Worldget_world () const
 Parent world accessor.
 
const DistributedIDid () const
 Group id accessor.
 
void local_update () const
 Local usage update.
 
void make_tree (const ProcessID group_root, ProcessID &parent, ProcessID &child0, ProcessID &child1) const
 Compute the binary tree parent and children.
 
ProcessID rank () const
 Group rank accessor.
 
ProcessID rank (const ProcessID world_rank) const
 Map world rank to group rank.
 
void remote_update (const int n) const
 Remote usage update.
 
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 void deleter (Impl *pimpl)
 Local group deleter.
 

Static Private Member Functions

template<typename vectorT >
static vectorT::const_iterator begin (const vectorT &v)
 Array const begin iterator accessor.
 
template<typename T , std::size_t N>
static Tbegin (T(&a)[N])
 Array begin iterator accessor.
 
template<typename vectorT >
static vectorT::const_iterator end (const vectorT &v)
 Array const end iterator accessor.
 
template<typename T , std::size_t N>
static Tend (T(&a)[N])
 Array end iterator accessor.
 
template<typename vectorT >
static std::enable_if<!std::is_array< vectorT >::value, std::size_t >::type size (const vectorT &v)
 Array size accessor.
 
template<typename T , std::size_t N>
static std::size_t size (T(&a)[N])
 Array size accessor.
 

Private Attributes

DistributedID did_
 Group distributed id.
 
ProcessID group_rank_
 The group rank of this process.
 
std::vector< ProcessIDgroup_to_world_map_
 List of nodes in the group.
 
AtomicInt local_count_
 Local use count.
 
AtomicInt remote_count_
 Remote use count.
 
Worldworld_
 Parent world for this group.
 

Constructor & Destructor Documentation

◆ Impl()

template<typename A >
madness::Group::Impl::Impl ( World world,
const A group,
const DistributedID did 
)
inline

Constructor.

Template Parameters
AAn std compliant array (e.g. std::array or std::vector)
Parameters
worldThe world that is the basis for this group
didThe distributed id associated with this group
groupAn array of Processes in world

References group_rank_, group_to_world_map_, local_count_, MADNESS_ASSERT, rank(), madness::World::rank(), remote_count_, size(), madness::World::size(), and world_.

Member Function Documentation

◆ begin() [1/2]

template<typename vectorT >
static vectorT::const_iterator madness::Group::Impl::begin ( const vectorT &  v)
inlinestaticprivate

Array const begin iterator accessor.

Template Parameters
vectorTThe array type
Parameters
vAn array object
Returns
The begin const_iterator of v

References v.

◆ begin() [2/2]

template<typename T , std::size_t N>
static T * madness::Group::Impl::begin ( T(&)  a[N])
inlinestaticprivate

Array begin iterator accessor.

Template Parameters
TThe array type
NThe size of the array
Parameters
aA c-style array
Returns
A pointer to the first element of a

References a.

◆ deleter()

static void madness::Group::Impl::deleter ( Impl pimpl)
inlinestatic

Local group deleter.

Updates the remote usage count with the negative of the local usage count by calling remote_update.

References local_count_, and remote_update().

◆ end() [1/2]

template<typename vectorT >
static vectorT::const_iterator madness::Group::Impl::end ( const vectorT &  v)
inlinestaticprivate

Array const end iterator accessor.

Template Parameters
vectorTThe array type
Parameters
vAn array object
Returns
The end cosnt_iterator of v

References v.

◆ end() [2/2]

template<typename T , std::size_t N>
static T * madness::Group::Impl::end ( T(&)  a[N])
inlinestaticprivate

Array end iterator accessor.

Template Parameters
TThe array type
NThe size of the array
Parameters
aA c-style array
Returns
A pointer to one past the last element of a

References a, and N.

Referenced by make_tree().

◆ get_world()

World & madness::Group::Impl::get_world ( ) const
inline

Parent world accessor.

Returns
A reference to the parent world of this group

References world_.

◆ id()

const DistributedID & madness::Group::Impl::id ( ) const
inline

Group id accessor.

Returns
A const reference to the group id

References did_.

◆ local_update()

void madness::Group::Impl::local_update ( ) const
inline

Local usage update.

Increment the local usage count by one.

References local_count_.

◆ make_tree()

void madness::Group::Impl::make_tree ( const ProcessID  group_root,
ProcessID parent,
ProcessID child0,
ProcessID child1 
) const
inline

Compute the binary tree parent and children.

Parameters
[in]group_rootThe head node of the binary tree
[out]parentThe parent node of the binary tree
[out]child0The left child node of the binary tree
[out]child1The right child node of the binary tree

References end(), group_rank_, group_to_world_map_, MADNESS_ASSERT, and me.

◆ rank() [1/2]

ProcessID madness::Group::Impl::rank ( ) const
inline

Group rank accessor.

Returns
The rank of this process in the group

References group_rank_.

Referenced by Impl().

◆ rank() [2/2]

ProcessID madness::Group::Impl::rank ( const ProcessID  world_rank) const
inline

Map world rank to group rank.

Parameters
world_rankThe world rank to be mapped
Returns
The group rank of world_rank when it is a member of this group, otherwise -1.

References std::distance(), group_to_world_map_, and world_rank().

◆ remote_update()

void madness::Group::Impl::remote_update ( const int  n) const
inline

Remote usage update.

Parameters
nThe value that will be added to the remote count Add n to the remote count. The remote count will be updated with the negative of the local count so the final value will be equal to zero when the group is ready for destruction. When the group is ready for destruction it will be removed from the group registry.

References did_, remote_count_, and madness::Group::unregister_group().

Referenced by deleter().

◆ size() [1/3]

ProcessID madness::Group::Impl::size ( ) const
inline

Group size accessor.

Returns
The number of processes in the group

References group_to_world_map_.

Referenced by Impl().

◆ size() [2/3]

template<typename vectorT >
static std::enable_if<!std::is_array< vectorT >::value, std::size_t >::type madness::Group::Impl::size ( const vectorT &  v)
inlinestaticprivate

Array size accessor.

Template Parameters
vectorTThe array type
Parameters
vAn array object
Returns
The size of array v

References v.

◆ size() [3/3]

template<typename T , std::size_t N>
static std::size_t madness::Group::Impl::size ( T(&)  a[N])
inlinestaticprivate

Array size accessor.

Template Parameters
TThe array type
NThe size of the array
Parameters
aA c-style array
Returns
The size of array a

References N.

◆ world_rank()

ProcessID madness::Group::Impl::world_rank ( const ProcessID  group_rank) const
inline

Map group rank to world rank.

Returns
The rank of this process in the world

References group_to_world_map_, and MADNESS_ASSERT.

Referenced by rank().

Member Data Documentation

◆ did_

DistributedID madness::Group::Impl::did_
private

Group distributed id.

Referenced by id(), and remote_update().

◆ group_rank_

ProcessID madness::Group::Impl::group_rank_
private

The group rank of this process.

Referenced by Impl(), make_tree(), and rank().

◆ group_to_world_map_

std::vector<ProcessID> madness::Group::Impl::group_to_world_map_
private

List of nodes in the group.

Referenced by Impl(), make_tree(), rank(), size(), and world_rank().

◆ local_count_

AtomicInt madness::Group::Impl::local_count_
mutableprivate

Local use count.

Referenced by Impl(), deleter(), and local_update().

◆ remote_count_

AtomicInt madness::Group::Impl::remote_count_
mutableprivate

Remote use count.

Referenced by Impl(), and remote_update().

◆ world_

World& madness::Group::Impl::world_
private

Parent world for this group.

Referenced by Impl(), and get_world().


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