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

RankRanges encapsulate multiple rank ranges which are used in functions like MPI_Group_range_incl/excl. More...

#include <rank_ranges.hpp>

Public Member Functions

 RankRanges (int(*rank_range_array)[3], size_t size)
 Constructor taking a plain two dimension c-style array.
 
template<typename RangeContainer >
 RankRanges (RangeContainer const &ranges)
 Constructor taking any container storing RankRange objects.
 
 ~RankRanges ()
 Destroys objects and deallocates any memory allocated during construction.
 
auto get () const
 Get non-owning access to the underlying c-style array storing the rank ranges.
 
auto size () const
 Number of ranges stored in this object.
 
bool contains (int rank) const
 Checks whether the rank ranges contain a certain rank.
 

Detailed Description

RankRanges encapsulate multiple rank ranges which are used in functions like MPI_Group_range_incl/excl.

MPI_Group_range_incl/excl use multidimensional integer arrays to represent rank ranges. One can therefore use plain c-style multi dimensional arrays directly which results in a zero-cost abstraction or use any container type storing RankRange object which are then converted to the required plain c-style array.

Constructor & Destructor Documentation

◆ RankRanges() [1/2]

kamping::RankRanges::RankRanges ( int(*) rank_range_array[3],
size_t size )
inline

Constructor taking a plain two dimension c-style array.

Parameters
rank_range_arrayPointer to int[3] representing contiguously stored plain MPI rank ranges.
sizeNumber of ranges stored in this array.

◆ RankRanges() [2/2]

kamping::RankRanges::RankRanges ( RangeContainer const & ranges)
inline

Constructor taking any container storing RankRange objects.

Parameters
rangesContainer storing RankRange objects.

Member Function Documentation

◆ contains()

bool kamping::RankRanges::contains ( int rank) const
inline

Checks whether the rank ranges contain a certain rank.

Returns
Whether rank ranges contain a certain rank.

◆ get()

auto kamping::RankRanges::get ( ) const
inline

Get non-owning access to the underlying c-style array storing the rank ranges.

Returns
Underlying c-style array of type int (*)[3].

◆ size()

auto kamping::RankRanges::size ( ) const
inline

Number of ranges stored in this object.

Returns
Number of ranges.

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