KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::Group Class Reference

A group of MPI processes. More...

#include <group.hpp>

Public Member Functions

 Group (MPI_Group group, bool owning=false)
 Constructs a new group from an existing MPI group.
 
 Group (Group const &)=delete
 
Group operator= (Group const &)=delete
 
 Group (Group &&other)
 Move constructor.
 
Groupoperator= (Group &&other)
 Move assignment.
 
template<typename Comm >
 Group (Comm const &comm)
 Constructs the group associated with a communicator.
 
 ~Group ()
 Default destructor, freeing the encapsulated group if owned.
 
GroupEquality compare (Group const &other) const
 Compare two groups.
 
bool is_identical (Group const &other) const
 Compare two groups.
 
bool is_similar (Group const &other) const
 Compare two groups.
 
bool has_same_ranks (Group const &other) const
 Compare two groups.
 
Group difference (Group const &other) const
 Makes a group from the difference of two groups.
 
Group intersection (Group const &other) const
 Makes a group from the intersection of two groups.
 
Group set_union (Group const &other) const
 Makes a group from the union of two groups.
 
size_t size () const
 Get the number of ranks in the group.
 
size_t rank () const
 Get the rank of the calling process in the group.
 

Static Public Member Functions

static Group empty ()
 Constructs an empty group.
 

Detailed Description

A group of MPI processes.

Member Function Documentation

◆ compare()

GroupEquality kamping::Group::compare ( Group const & other) const
inline

Compare two groups.

Parameters
otherThe group to compare with.
Returns
The equality of the two groups (see GroupEquality).

◆ difference()

Group kamping::Group::difference ( Group const & other) const
inline

Makes a group from the difference of two groups.

Parameters
otherThe other group.
Returns
A group containing all the ranks of the first group that are not in the second group.

◆ empty()

static Group kamping::Group::empty ( )
inlinestatic

Constructs an empty group.

Returns
An empty group.

◆ has_same_ranks()

bool kamping::Group::has_same_ranks ( Group const & other) const
inline

Compare two groups.

Parameters
otherThe group to compare with.
Returns
True if the groups are identical; see GroupEquality. False otherwise.

◆ intersection()

Group kamping::Group::intersection ( Group const & other) const
inline

Makes a group from the intersection of two groups.

Parameters
otherThe other group.
Returns
A group containing only the ranks present in both groups.

◆ is_identical()

bool kamping::Group::is_identical ( Group const & other) const
inline

Compare two groups.

Parameters
otherThe group to compare with.
Returns
True if the groups are identical; see GroupEquality. False otherwise.

◆ is_similar()

bool kamping::Group::is_similar ( Group const & other) const
inline

Compare two groups.

Parameters
otherThe group to compare with.
Returns
True if the groups are similar; see GroupEquality. False otherwise.

◆ rank()

size_t kamping::Group::rank ( ) const
inline

Get the rank of the calling process in the group.

Returns
The rank of the calling process in the group.

◆ set_union()

Group kamping::Group::set_union ( Group const & other) const
inline

Makes a group from the union of two groups.

Parameters
otherThe other group.
Returns
A group containing all ranks present in either of the two groups.
Note
The set_ prefix was choosen in order to avoid a name clash with the C++ keyword union.

◆ size()

size_t kamping::Group::size ( ) const
inline

Get the number of ranks in the group.

Returns
The number of ranks in the group.

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