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

Representation of a communicator definition. More...

#include <pearl/Communicator.h>

Inheritance diagram for pearl::Communicator:
pearl::MpiComm

Public Types

typedef uint32_t IdType
 Communicator definition identifier type. More...
 

Public Member Functions

Constructors & destructor
 Communicator (IdType id, const String &name, const CommSet &commSet, const Communicator *parent)
 Constructor. More...
 
virtual ~Communicator ()
 Destructor. More...
 
Query functions
IdType getId () const
 Get global identifier. More...
 
const StringgetName () const
 Get communicator name. More...
 
const CommSetgetCommSet () const
 Get associated communication set. More...
 
const CommunicatorgetParent () const
 Get parent communicator. More...
 
uint32_t getSize () const
 Get size. More...
 
Paradigm getParadigm () const
 Get paradigm. More...
 

Static Public Attributes

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

Related Functions

(Note that these are not member functions.)

Stream I/O functions
std::ostream & operator<< (std::ostream &stream, const Communicator &item)
 Stream output operator. More...
 
Comparison operators
bool operator== (const Communicator &lhs, const Communicator &rhs)
 Equality operator. More...
 
bool operator!= (const Communicator &lhs, const Communicator &rhs)
 Inequality operator. More...
 

Detailed Description

Instances of the Communicator definition class provide information about communication contexts. Communicators are characterized by an identifier, a name, a parent communicator, and an associated group of locations (the communication set).

Member Typedef Documentation

◆ IdType

typedef uint32_t pearl::Communicator::IdType

Constructor & Destructor Documentation

◆ Communicator()

pearl::Communicator::Communicator ( IdType  id,
const String name,
const CommSet commSet,
const Communicator parent 
)

Creates a new instance with the given global identifier id, communicator name, associated communication set commSet, and a parent communicator.

Parameters
idGlobal communicator identifier
nameCommunicator name
commSetAssociated communication set
parentParent communicator (nullptr for root communicators or when this information is not available)
        \n@par Exception safety\n        <b class="paramname">No-throw guarantee:</b>         never throws exceptions.        <br>\n

◆ ~Communicator()

virtual pearl::Communicator::~Communicator ( )
virtual

Destroys the communicator instance.

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

Member Function Documentation

◆ getCommSet()

const CommSet& pearl::Communicator::getCommSet ( ) const

Returns a constant reference to the associated communication set.

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

◆ getId()

IdType pearl::Communicator::getId ( ) const

Returns the global identifier of the communicator definition.

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

◆ getName()

const String& pearl::Communicator::getName ( ) const

Returns a constant reference to the string definition storing the communicators's name. If this information is not available, String::UNDEFINED is returned.

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

◆ getParadigm()

Paradigm pearl::Communicator::getParadigm ( ) const

Returns the paradigm associated to this communicator.

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

◆ getParent()

const Communicator* pearl::Communicator::getParent ( ) const

Returns a pointer to the parent communicator if applicable. Returns nullptr for root communicators or when this information is not available.

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

◆ getSize()

uint32_t pearl::Communicator::getSize ( ) const

Returns the size of this communicator (i.e., the number of ranks in the associated communication set).

Returns
Communicator size
        \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 Communicator lhs,
const Communicator rhs 
)
related

Compares two communicator definition objects lhs and rhs for inequality. Two communicators are considered unequal if either their IDs, names, associated process groups, or parents differ.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the communicator definitions differ, false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  stream,
const Communicator item 
)
related

Prints the contents of the given communicator definition object item to an output stream in a human-readable form.

Parameters
streamOutput stream
itemCommunicator definition object
Returns
Output stream

◆ operator==()

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

Compares two communicator definition objects lhs and rhs for equality. Two communicators are considered equal if their identifiers, names, associated process groups, and parents are identical.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the communicator definitions are equal, false otherwise.

Member Data Documentation

◆ NO_ID

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

◆ UNDEFINED

const Communicator pearl::Communicator::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