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

Representation of a location definition. More...

#include <pearl/Location.h>

Public Types

enum  Type {
  TYPE_UNKNOWN,
  TYPE_CPU_THREAD,
  TYPE_GPU,
  TYPE_METRIC,
  NUMBER_OF_TYPES
}
 Location types. More...
 
typedef uint64_t IdType
 Location definition identifier type. More...
 

Public Member Functions

Constructors & destructor
 Location (IdType id, const String &name, Type type, uint64_t numEvents, LocationGroup *parent)
 Constructor. More...
 
Access definition data
IdType getId () const
 Get global identifier. More...
 
const StringgetName () const
 Get location name. More...
 
Type getType () const
 Get location type. More...
 
uint64_t getNumEvents () const
 Get number of events. More...
 
LocationGroupgetParent () const
 Get parent node. More...
 
Access location properties
SystemNode::IdType getMachineId () const
 Get machine identifier. More...
 
SystemNode::IdType getNodeId () const
 Get node identifier. More...
 
int getRank () const
 Get process rank. More...
 
uint32_t getThreadId () const
 Get thread identifier. More...
 

Static Public Attributes

static const IdType NO_ID = (~static_cast<IdType>(0))
 Numerical identifier used for undefined location definitions. More...
 
static const Location UNDEFINED
 Static instance of class Location representing undefined location 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 Location &item)
 Stream output operator. More...
 
Comparison operators
bool operator== (const Location &lhs, const Location &rhs)
 Equality operator. More...
 
bool operator!= (const Location &lhs, const Location &rhs)
 Inequality operator. More...
 

Detailed Description

Instances of the Location class provide information about the leaf nodes in the system hierarchy for which actual event trace data exists. A location therefore either represents a stream of execution on either a CPU or GPU, or a stream of metric values related to the system tree node to which the parent location group is attached. Locations are characterized by a name, a type, the number of stored events, and the parent location group. The numerical identifiers of the individual locations are globally defined, but not necessarily continuously enumerated.

Member Typedef Documentation

◆ IdType

typedef uint64_t pearl::Location::IdType

Member Enumeration Documentation

◆ Type

Every location has a type field associated to it which encodes more specific information about the location.

Enumerator
TYPE_UNKNOWN 

Unknown type, used only if no other type fits.

TYPE_CPU_THREAD 

Location corresponds to a CPU thread

TYPE_GPU 

Location corresponds to a GPU thread

TYPE_METRIC 

Location corresponds to non-thread level metric data

NUMBER_OF_TYPES 

Not a valid type, for internal use only.

Constructor & Destructor Documentation

◆ Location()

pearl::Location::Location ( IdType  id,
const String name,
Type  type,
uint64_t  numEvents,
LocationGroup parent 
)

Creates a new location definition instance and initializes it with the given values.

Parameters
idGlobal location identifier
nameLocation name
typeLocation type
numEventsNumber of events stored
parentParent location group (non-NULL)

Member Function Documentation

◆ getId()

IdType pearl::Location::getId ( ) const

Returns the global identifier of the location definition.

Returns
Global identifier

◆ getMachineId()

SystemNode::IdType pearl::Location::getMachineId ( ) const

Returns the global system node identifier of the machine this location belongs to.

Returns
Machine identifier

◆ getName()

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

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

Returns
Location name

◆ getNodeId()

SystemNode::IdType pearl::Location::getNodeId ( ) const

Returns the global system node identifier of the machine node this location belongs to.

Returns
Node identifier

◆ getNumEvents()

uint64_t pearl::Location::getNumEvents ( ) const

Returns the number of event records stored for this location.

Returns
Number of events

◆ getParent()

LocationGroup* pearl::Location::getParent ( ) const

Returns a pointer to the parent location group.

Returns
Parent group

◆ getRank()

int pearl::Location::getRank ( ) const

Returns the MPI rank of the process. If this information is not available, -1 is returned.

Returns
MPI rank

◆ getThreadId()

uint32_t pearl::Location::getThreadId ( ) const

Returns the unique thread identifier of this location within the corresponding process.

Returns
Thread identifier

◆ getType()

Type pearl::Location::getType ( ) const

Returns the location type, encoding more detailed information. See the documentation of Location::Type for details.

Returns
Location type

Friends And Related Function Documentation

◆ operator!=()

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

Compares two location definition objects lhs and rhs for inequality. Two location definitions are considered unequal if either their global identifiers, names, types, or parents differ. The number of events is not considered.

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

◆ operator<<()

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

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

Parameters
streamOutput stream
itemLocation definition object
Returns
Output stream

◆ operator==()

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

Compares two location definition objects lhs and rhs for equality. Two location definitions are considered equal if their global identifiers, names, types, and parents are identical. The number of events is not considered.

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

Member Data Documentation

◆ NO_ID

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

◆ UNDEFINED

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