PEARL
Parallel Event Access and Replay Library
Static Public Attributes | List of all members
pearl::CommSet Class Reference

Grouping set definition representation for defining a subgroup of Location definition objects from a communication location set. More...

#include <pearl/CommSet.h>

Inheritance diagram for pearl::CommSet:
pearl::GroupingSet pearl::uncopyable::Uncopyable pearl::MpiGroup

Public Member Functions

Constructors & destructor
 CommSet (IdType id, const String &name, const Properties &properties, const CommLocationSet &commLocationSet, const std::vector< uint32_t > &ranks)
 Constructor. More...
 
Query functions
virtual SetType getType () const
 Get grouping set type. More...
 
Properties getProperties () const
 Get grouping set properties. More...
 
const CommLocationSetgetCommLocationSet () const
 Get communication location set. More...
 
Paradigm getParadigm () const
 Get paradigm. More...
 
uint32_t numRanks () const
 Get number of ranks. More...
 
uint32_t getLocalRank (uint32_t globalRank) const
 Convert global to local rank. More...
 
uint32_t getGlobalRank (uint32_t localRank) const
 Convert local to global rank. More...
 
const LocationgetLocation (uint32_t localRank) const
 Get location by rank. More...
 
- Public Member Functions inherited from pearl::GroupingSet
IdType getId () const
 Get global identifier. More...
 
const StringgetName () const
 Get grouping set name. More...
 
virtual ~GroupingSet ()
 Destructor. More...
 

Static Public Attributes

static const IdType NO_ID = (~static_cast< IdType >(0))
 Numerical identifier used for undefined communication set definitions. More...
 
static const CommSet UNDEFINED
 Static instance of class CommSet representing undefined communication set entries in other definitions. More...
 

Related Functions

(Note that these are not member functions.)

Comparison operators
bool operator== (const CommSet &lhs, const CommSet &rhs)
 Equality operator. More...
 
bool operator!= (const CommSet &lhs, const CommSet &rhs)
 Inequality operator. More...
 

Additional Inherited Members

- Public Types inherited from pearl::GroupingSet
enum  SetType {
  LOCATION_SET,
  REGION_SET,
  METRIC_SET,
  COMM_LOCATION_SET,
  COMM_SET
}
 Grouping set types. More...
 
enum  Property {
  PROPERTY_NONE = 0,
  PROPERTY_SELF = (1 << 0),
  PROPERTY_WORLD = (1 << 1),
  PROPERTY_GLOBAL_RANKS = (1 << 2)
}
 Grouping set properties. More...
 
typedef uint32_t IdType
 Grouping set definition identifier type. More...
 
typedef Flags< Property, uint8_t > Properties
 Grouping set property flags type. More...
 
- Protected Member Functions inherited from pearl::GroupingSet
 GroupingSet (IdType id, const String &name)
 Constructor. More...
 

Detailed Description

The CommSet class provides a specialized grouping set definition representation for defining a subgroup of Location definition objects from the associated communication location set. The group is defined through an ordered set of identifiers (global ranks), which correspond to the indices of the Location definition objects in the associated communication location set. This also implicitly assigns a local rank in the range [0,#members-1] with respect to this communication set to each member Location.

CommSet instances define subgroups of locations involved in some form of communication or synchronization. Examples of such subgroups are MPI groups or OpenMP thread teams.

Constructor & Destructor Documentation

◆ CommSet()

pearl::CommSet::CommSet ( IdType  id,
const String name,
const Properties properties,
const CommLocationSet commLocationSet,
const std::vector< uint32_t > &  ranks 
)

Creates a new instance with the given global identifier id, communication set name, properties, the associated communication location set commLocationSet, and a ranks vector providing a list of global ranks defining the subset.

Note
ranks should be empty if the GroupingSet::PROPERTY_WORLD property flag is set.
Parameters
idGlobal grouping set identifier
nameCommunication set group name
propertiesProperty flags
commLocationSetAssociated communication location set
ranksList of ranks (i.e., indices in commLocationSet) defining the subset
        \n@par Exception safety\n        <b class="paramname">Strong guarantee:</b>         no effects in case an exception is thrown.        <br>\n
Exceptions
std::bad_allocon failure to allocate storage

Member Function Documentation

◆ getCommLocationSet()

const CommLocationSet& pearl::CommSet::getCommLocationSet ( ) const

Returns a constant reference to the associated communication location set.

Returns
Communciaton location set
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

◆ getGlobalRank()

uint32_t pearl::CommSet::getGlobalRank ( uint32_t  localRank) const

Returns the global rank of the subset member with the given local rank localRank with respect to this communication set.

Parameters
localRankLocal rank with respect to this communciation set
Returns
Global rank identifier
        \n@par Exception safety\n        <b class="paramname">Strong guarantee:</b>         no effects in case an exception is thrown.        <br>\n
Exceptions
RuntimeErroron localRank ∉ [0,#num_ranks-1]

◆ getLocalRank()

uint32_t pearl::CommSet::getLocalRank ( uint32_t  globalRank) const

Returns the local rank of the subset member with the given global rank globalRank with respect to this communication set.

Parameters
globalRankGlobal rank identifier
Returns
Local rank with respect to this communciation set
        \n@par Exception safety\n        <b class="paramname">Strong guarantee:</b>         no effects in case an exception is thrown.        <br>\n
Exceptions
RuntimeErroron failure to find globalRank in this communication set

◆ getLocation()

const Location& pearl::CommSet::getLocation ( uint32_t  localRank) const

Returns a constant reference to the Location definition object with the given localRank.

Parameters
localRankLocal rank with respect to this communication set.
Returns
Constant reference to the corresponding Location object
        \n@par Exception safety\n        <b class="paramname">Strong guarantee:</b>         no effects in case an exception is thrown.        <br>\n
Exceptions
pearl::RuntimeErroron localRank ∉ [0,#num_ranks-1]

◆ getParadigm()

Paradigm pearl::CommSet::getParadigm ( ) const

Returns the paradigm associated to this communication set.

Returns
Communication paradigm
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

◆ getProperties()

Properties pearl::CommSet::getProperties ( ) const

Returns the property flags of this communication set.

Returns
Property flags
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

◆ getType()

virtual SetType pearl::CommSet::getType ( ) const
virtual

Returns the type of the grouping set.

Returns
Set type (i.e., GroupingSet::COMM_SET)
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

Implements pearl::GroupingSet.

◆ numRanks()

uint32_t pearl::CommSet::numRanks ( ) const

Returns the number of ranks in this communication set.

Returns
Number of ranks
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const CommSet lhs,
const CommSet rhs 
)
related

Compares two communication set definition objects lhs and rhs for inequality. Two communication sets are considered unequal if either their identifiers, names, property flags, or the sizes of the rank lists differ.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the communication set definitions differ, false otherwise.
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

◆ operator==()

bool operator== ( const CommSet lhs,
const CommSet rhs 
)
related

Compares two communication set definition objects lhs and rhs for equality. Two communication sets are considered equal if their identifiers, names, property flags, and the sizes of the rank lists are identical.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the communication set definitions are equal, false otherwise.
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

Member Data Documentation

◆ NO_ID

const IdType pearl::CommSet::NO_ID = (~static_cast< IdType >(0))
static

◆ UNDEFINED

const CommSet pearl::CommSet::UNDEFINED
static

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

Scalasca    Copyright © 1998–2019 Forschungszentrum Jülich GmbH, Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming