Machine Class Reference
[PEARL.base]

Stores information related to a machine used during trace file generation. More...

#include <Machine.h>

Inheritance diagram for Machine:

NamedObject IdObject

List of all members.

Public Member Functions

Constructors & destructor
 Machine (ident_t id, const std::string &name, uint32_t num_nodes)
Get & set machine information
uint32_t num_nodes () const
Nodeget_node (uint32_t index) const
void add_node (Node *node)


Detailed Description

The class Machine constitutes the top level of the system hierarchy. Its instances provide information about a single machine used during trace file generation. Each machine consists of at least one Node.

The numerical identifiers of the individual machines are globally defined and continuously enumerated, i.e., the ID is element of [0,#machines-1].

Note:
The Node objects added to a machine are only referenced and not owned by the corresponding Machine object. Therefore, they will not be deleted if the Machine object is released.

Constructor & Destructor Documentation

Machine ( ident_t  id,
const std::string &  name,
uint32_t  num_nodes 
)

Creates a new instance and sets its identifier and name to the given values id and name, respectively. The third parameter num_nodes specifies the expected number of nodes of the machine and is used as a hint for memory allocation purposes.

Right after the initialization, there are no nodes associated with the machine. That is, the programmer is responsible for adding at least one node to the machine using the add_node() method.

Parameters:
id Machine identifier
name Machine name
num_nodes Expected number of nodes


Member Function Documentation

void add_node ( Node node  ) 

Adds the given node to the list of nodes representing the machine. If node is already associated to the machine, the call is silently ignored. In addition, the machine pointer of node is updated.

Parameters:
node New node object

Node * get_node ( uint32_t  index  )  const

Returns a pointer to an Node object representing the associated physical node with the given index. These indices are local to this machine (i.e., index must be an element of [0,num_nodes()-1]) and independent of the global node identifiers. However, the nodes are stored in ascending order with respect to their IDs.

Parameters:
index Index of the requested node
Returns:
Corresponding Node object
Exceptions:
RuntimeError if the given index is invalid ("Index out of bounds")

uint32_t num_nodes (  )  const

Returns the number of nodes associated with the machine.

Returns:
Number of nodes


SCALASCA    Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre