![]() |
PEARL
Parallel Event Access and Replay Library
|
Representation of a region definition. More...
#include <pearl/Region.h>
Public Types | |
enum | { cCLASS_INTERNAL = (0 << 24), cCLASS_USER = (1 << 24), cCLASS_MPI = (2 << 24), cCLASS_OMP = (4 << 24), cCLASS_ARMCI = (8 << 24), cCAT_MPI_SETUP = (1 << 16), cCAT_MPI_COLLECTIVE = (2 << 16), cCAT_MPI_P2P = (4 << 16), cCAT_MPI_RMA = (8 << 16), cCAT_MPI_IO = (16 << 16), cCAT_OMP_PARALLEL = (1 << 16), cCAT_OMP_SYNC = (2 << 16), cCAT_ARMCI_COMM = (1 << 16), cCAT_ARMCI_SYNC = (2 << 16), cTYPE_OMP_BARRIER = (1 << 8), cMODE_OMP_IMPLICIT = (1 << 0), cMODE_OMP_EXPLICIT = (2 << 0), cTYPE_MPI_INIT = (1 << 8), cTYPE_MPI_FINALIZE = (2 << 8), cTYPE_MPI_BARRIER = (1 << 8), cTYPE_MPI_ONE_TO_N = (2 << 8), cTYPE_MPI_N_TO_ONE = (4 << 8), cTYPE_MPI_N_TO_N = (8 << 8), cTYPE_MPI_PARTIAL = (16 << 8), cTYPE_MPI_SEND = (1 << 8), cTYPE_MPI_RECV = (2 << 8), cTYPE_MPI_SENDRECV = (3 << 8), cTYPE_MPI_TEST = (4 << 8), cTYPE_MPI_WAIT = (8 << 8), cTYPE_MPI_RMA_COMM = (1 << 8), cTYPE_MPI_RMA_COLL = (2 << 8), cTYPE_MPI_RMA_GATS = (4 << 8), cTYPE_MPI_RMA_PASSIVE = (8 << 8), cTYPE_ARMCI_INIT = (1 << 8), cTYPE_ARMCI_FINALIZE = (2 << 8), cTYPE_ARMCI_ALLFENCE = (4 << 8), cTYPE_ARMCI_BARRIER = (8 << 8), cMODE_MPI_STANDARD = (1 << 0), cMODE_MPI_SYNCHRONOUS = (2 << 0), cMODE_MPI_BUFFERED = (4 << 0), cMODE_MPI_READY = (8 << 0), cMODE_MPI_NONBLOCKING = (16 << 0), cMODE_MPI_PERSISTENT = (32 << 0), cMODE_MPI_SINGLE = (1 << 0), cMODE_MPI_MANY = (2 << 0), cMODE_RMA_PUT = (1 << 0), cMODE_RMA_GET = (2 << 0), cMODE_RMA_START = (1 << 0), cMODE_RMA_COMPLETE = (2 << 0), cMODE_RMA_POST = (4 << 0), cMODE_RMA_WAIT = (8 << 0), cMODE_RMA_TEST = (16 << 0), cMODE_RMA_FENCE = (1 << 0), cMODE_RMA_WIN_CREATE = (2 << 0), cMODE_RMA_WIN_FREE = (4 << 0), cMODE_RMA_LOCK = (1 << 0), cMODE_RMA_UNLOCK = (2 << 0) } |
Symbolic names for region classification. More... | |
enum | Role { ROLE_UNKNOWN, ROLE_FUNCTION, ROLE_WRAPPER, ROLE_LOOP, ROLE_CODE, ROLE_PARALLEL, ROLE_SECTIONS, ROLE_SECTION, ROLE_SINGLE, ROLE_SINGLE_SBLOCK, ROLE_WORKSHARE, ROLE_MASTER, ROLE_CRITICAL, ROLE_CRITICAL_SBLOCK, ROLE_BARRIER, ROLE_IMPLICIT_BARRIER, ROLE_ATOMIC, ROLE_FLUSH, ROLE_ORDERED, ROLE_ORDERED_SBLOCK, ROLE_TASK, ROLE_TASK_CREATE, ROLE_TASK_WAIT, ROLE_COLL_ONE2ALL, ROLE_COLL_ALL2ONE, ROLE_COLL_ALL2ALL, ROLE_COLL_OTHER, ROLE_FILE_IO, ROLE_POINT2POINT, ROLE_RMA, ROLE_DATA_TRANSFER, ROLE_ARTIFICIAL, NUMBER_OF_ROLES } |
Region roles. More... | |
enum | Paradigm { PARADIGM_UNKNOWN, PARADIGM_USER, PARADIGM_COMPILER, PARADIGM_OPENMP, PARADIGM_MPI, PARADIGM_CUDA, PARADIGM_MEASUREMENT_SYSTEM, NUMBER_OF_PARADIGMS } |
Region paradigms. More... | |
typedef uint32_t | IdType |
Region definition identifier type. | |
Public Member Functions | |
IdType | getId () const |
Get global identifier. | |
const String & | getCanonicalName () const |
Get canonical region name. | |
const String & | getDisplayName () const |
Get display region name. | |
const String & | getDescription () const |
Get region description. | |
Role | getRole () const |
Get region role. | |
Paradigm | getParadigm () const |
Get region paradigm. | |
const String & | getFilename () const |
Get filename. | |
uint32_t | getStartLine () const |
Get start line number. | |
uint32_t | getEndLine () const |
Get end line number. | |
uint32_t | getClassification () const |
Get region classification. | |
Constructors & destructor | |
Region (IdType id, const String &canonicalName, const String &displayName, const String &description, Role role, Paradigm paradigm, const String &filename, uint32_t startLine, uint32_t endLine) | |
Constructor. | |
Static Public Attributes | |
static const IdType | NO_ID = (~static_cast<IdType>(0)) |
Numerical identifier used for undefined region definitions. | |
static const Region | UNDEFINED |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const Region &lhs, const Region &rhs) |
Equality operator. | |
bool | operator!= (const Region &lhs, const Region &rhs) |
Inequality operator. | |
Stream I/O functions | |
std::ostream & | operator<< (std::ostream &stream, const Region &item) |
Stream output operator. |
Instances of the Region class provide information about source-code regions of the target application. Regions are characterized by their canonical name (typically the linker decorated, i.e., mangled name), their display name (i.e., the demangled name if available), a file in which this region is defined, begin and end line numbers, as well as a region type. In addition, a free-form textual description can be provided. The numerical identifiers of the individual regions are globally defined and continuously enumerated, i.e., the ID is element of [0,#regions-1].
typedef uint32_t pearl::Region::IdType |
anonymous enum |
Every region has a paradigm field associated to it. The paradigm encodes the programming model the region refers to (e.g., MPI or OpenMP), or how the region was captured (e.g., through compiler or user instrumentation).
enum pearl::Region::Role |
Every region has a role field associated to it. The role encodes more specific information about the region, in particular to which kind of language construct (e.g., function, loop, OpenMP construct) the region refers to.
pearl::Region::Region | ( | IdType | id, |
const String & | canonicalName, | ||
const String & | displayName, | ||
const String & | description, | ||
Role | role, | ||
Paradigm | paradigm, | ||
const String & | filename, | ||
uint32_t | startLine, | ||
uint32_t | endLine | ||
) |
Creates a new region definition instance and initializes it with the given values.
id | Global region identifier |
canonicalName | Region name (typically mangled) |
displayName | Region name (demangled if available, otherwise identical to canonicalName) |
description | Free-form region description (optional, String::UNDEFINED otherwise) |
role | Region role |
paradigm | Region paradigm |
filename | Name of source file in which the region is defined (String::UNDEFINED if unknown) |
startLine | Line number where the region starts (zero if unknown) |
endLine | Line number where the region ends (zero if unknown) |
const String& pearl::Region::getCanonicalName | ( | ) | const |
Returns the string definition storing the canonical region name. For compiler-instrumented functions, this is typically the mangled (i.e., linker-decorated) name. For other regions, it can be an arbitrary character string.
uint32_t Region::getClassification | ( | ) | const [inline] |
Returns a 32-bit unsigned integer value providing an encoded classification of the region. This member functions and its return value is not intended to be used directly. Instead, the region predicate functions should be called from client code.
const String& pearl::Region::getDescription | ( | ) | const |
Returns the string definition storing the free-form region description associated with the source-code region. If this information is not available, String::UNDEFINED is returned.
const String& pearl::Region::getDisplayName | ( | ) | const |
Returns the string definition storing the region's display name. For compiler-instrumented functions, this corresponds to the demangled name if available, otherwise it is identical to the canonical name. For other regions, it can ba an arbitrary character string.
uint32_t pearl::Region::getEndLine | ( | ) | const |
Returns the line number where the region ends in the associated source file (zero if this information is not available).
const String& pearl::Region::getFilename | ( | ) | const |
Returns the string definition storing the name of the file in which the region is defined. If this information is not available, String::UNDEFINED is returned.
IdType pearl::Region::getId | ( | ) | const |
Returns the global identifier of the region definition.
Paradigm pearl::Region::getParadigm | ( | ) | const |
Returns the region paradigm, encoding more detailed information on the programmind model or how the region got generated, respectively. See the documentation of Region::Paradigm for details.
Role pearl::Region::getRole | ( | ) | const |
Returns the region role, encoding more detailed information. See the documentation of Region::Role for details.
uint32_t pearl::Region::getStartLine | ( | ) | const |
Returns the line number where the region starts in the associated source file (zero if this information is not available).
Compares two region definition objects lhs and rhs for inequality. Two region definitions are considered unequal if any of their attributes differ.
lhs | Left-hand operand |
rhs | Right-hand operand |
std::ostream & operator<< | ( | std::ostream & | stream, |
const Region & | item | ||
) | [related] |
Prints the contents of the given region definition object item to an output stream in a human-readable form.
stream | Output stream |
item | Region definition object |
Compares two region definition objects lhs and rhs for equality. Two region definitions are considered equal if all of their attributes are identical.
lhs | Left-hand operand |
rhs | Right-hand operand |
const IdType pearl::Region::NO_ID = (~static_cast<IdType>(0)) [static] |
const Region pearl::Region::UNDEFINED [static] |
Static instance of class Region representing undefined region entries in other definitions.
![]() |
Copyright © 1998–2014 Forschungszentrum Jülich GmbH,
Jülich Supercomputing Centre
Copyright © 2009–2014 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming |