Node Class Reference
[PEARL.base]

Stores information related to a node that is part of a machine used for trace generation. More...

#include <Node.h>

Inheritance diagram for Node:

NamedObject IdObject

List of all members.

Public Member Functions

Constructors & destructor
 Node (ident_t id, const std::string &name, uint32_t num_cpus, double clockrate)
Get & set node information
uint32_t num_processes () const
uint32_t num_cpus () const
Processget_process (uint32_t index) const
void add_process (Process *process)
Machineget_machine () const
double get_clockrate () const


Detailed Description

Instances of the Node class provide information about a single node. A node is a physical part of a Machine with a single address space and one or more CPUs. It can host a subset of the application's processes (see class Process).

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

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

Constructor & Destructor Documentation

Node ( ident_t  id,
const std::string &  name,
uint32_t  num_cpus,
double  clockrate 
)

Creates a new instance and initializes the data with the given values. The number of CPUs is used as a hint for memory allocation purposes, since it is considered to be the expected number of processes running on this node.

Right after the initialization, the node is not associated with any machine. Likewise, there are no processes bound to the node.

Parameters:
id Node identifier
name Node name
num_cpus Number of CPUs
clockrate Clock frequency of each CPU


Member Function Documentation

void add_process ( Process process  ) 

Adds the given process to the list of processes running to this node. If process is already associated to the node, the call is silently ignored. In addition, the node pointer of the process is updated.

Parameters:
process New process object

double get_clockrate (  )  const

Returns the clock frequency of each CPU of this node.

Returns:
Clock frequency

Machine * get_machine (  )  const

Returns the machine this node belongs to. If the node has not been added to a machine yet, a NULL pointer is returned.

Returns:
Associated machine

Process * get_process ( uint32_t  index  )  const

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

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

uint32_t num_cpus (  )  const

Returns the number of CPUs of this node.

Returns:
Number of CPUs

uint32_t num_processes (  )  const

Returns the number of processes running on this node.

Returns:
Number of processes


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