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

Representation of a Cartesian grid topology definition. More...

#include <pearl/CartTopology.h>

Inheritance diagram for pearl::CartTopology:
pearl::uncopyable::Uncopyable

Public Types

typedef uint32_t IdType
 CartTopology definition identifier type. More...
 
typedef std::vector< const CartDimension * > DimensionContainer
 Container type for topology dimensions. More...
 
typedef std::map< uint32_t, CartCoordListCoordinateContainer
 Container type to store rank -> list of coordinates mapping. More...
 

Public Member Functions

Constructors & destructor
 CartTopology (IdType id, const String &name, const Communicator &communicator, const DimensionContainer &dimensions)
 Constructor. More...
 
virtual ~CartTopology ()
 Destructor. More...
 
Access definition data
IdType getId () const
 Get global identifier. More...
 
const StringgetName () const
 Get topology name. More...
 
const CommunicatorgetCommunicator () const
 Get associated communicator. More...
 
uint8_t numDimensions () const
 Get number of dimensions. More...
 
const CartDimensiongetDimension (uint8_t index) const
 Get dimension information. More...
 
const CartCoordList getRankCoordinates (uint32_t rank) const
 Get rank coordinates. More...
 

Protected Attributes

CoordinateContainer mCoordinates
 Topology coordinate map: rank in associated communicator -> list of coordinates. More...
 
const CommunicatormCommunicator
 Associated communicator. More...
 

Related Functions

(Note that these are not member functions.)

Stream I/O functions
std::ostream & operator<< (std::ostream &stream, const CartTopology &item)
 Stream output operator. More...
 

Detailed Description

The CartTopology class provides a representation of a Cartesian grid topology definition.

Member Typedef Documentation

◆ CoordinateContainer

◆ DimensionContainer

◆ IdType

typedef uint32_t pearl::CartTopology::IdType

Constructor & Destructor Documentation

◆ CartTopology()

pearl::CartTopology::CartTopology ( IdType  id,
const String name,
const Communicator communicator,
const DimensionContainer dimensions 
)

Creates a new instance with the given global identifier id, topology name, associated communicator, and list of dimensions.

Parameters
idGlobal Cartesian grid topology identifier
nameName (label) of the topology
communicatorAssociated communicator
dimensionsList of topology dimension definition objects
        \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

◆ ~CartTopology()

virtual pearl::CartTopology::~CartTopology ( )
virtual

Destroys the CartTopology instance.

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

Member Function Documentation

◆ getCommunicator()

const Communicator& pearl::CartTopology::getCommunicator ( ) const

Returns the communicator definition associated to the topology.

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

◆ getDimension()

const CartDimension& pearl::CartTopology::getDimension ( uint8_t  index) const

Returns the Cartesian grid topology dimension definition storing information of the dimension with the given index.

Parameters
indexDimension index in the range [0,#dimensions-1]
Returns
Requested dimension
        \n@par Exception safety\n        <b class="paramname">Strong guarantee:</b>         no effects in case an exception is thrown.        <br>\n
Exceptions
RuntimeErrorif index is out of bounds

◆ getId()

IdType pearl::CartTopology::getId ( ) const

Returns the global identifier of the Cartesian grid topology 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::CartTopology::getName ( ) const

Returns the string definition storing the topology name. If this information is not available, String::UNDEFINED is returned.

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

◆ getRankCoordinates()

const CartCoordList pearl::CartTopology::getRankCoordinates ( uint32_t  rank) const

Returns a (potentially empty) list of Cartesian coordinates assigned to the given rank.

Parameters
rankLocal rank in associated communicator
Returns
List of assigned coordinates (may be empty)
        \n@par Exception safety\n        <b class="paramname">Strong guarantee:</b>         no effects in case an exception is thrown.        <br>\n
Exceptions
RuntimeErroron rank ∉ [0,communicator.getSize()-1]

◆ numDimensions()

uint8_t pearl::CartTopology::numDimensions ( ) const

Returns the number of Cartesian grid topology dimensions.

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

Friends And Related Function Documentation

◆ operator<<()

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

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

Parameters
streamOutput stream
itemCartesian grid topology definition object
Returns
Output stream

Member Data Documentation

◆ mCommunicator

const Communicator* pearl::CartTopology::mCommunicator
protected

◆ mCoordinates

CoordinateContainer pearl::CartTopology::mCoordinates
protected

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