#include <Node.h>
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 |
Process * | get_process (uint32_t index) const |
void | add_process (Process *process) |
Machine * | get_machine () const |
double | get_clockrate () const |
The numerical identifiers of the individual nodes are globally defined and continuously enumerated, i.e., the ID is element of [0,#nodes-1].
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.
id | Node identifier | |
name | Node name | |
num_cpus | Number of CPUs | |
clockrate | Clock frequency of each CPU |
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.
process | New process object |
double get_clockrate | ( | ) | const |
Returns the clock frequency of each CPU of this node.
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.
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.
index | Index of the requested process |
RuntimeError | if an invalid index is given ("Index out of bounds") |
uint32_t num_cpus | ( | ) | const |
Returns the number of CPUs of this node.
uint32_t num_processes | ( | ) | const |
Returns the number of processes running on this node.
![]() |
Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre |