#include <Machine.h>
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 |
Node * | get_node (uint32_t index) const |
void | add_node (Node *node) |
The numerical identifiers of the individual machines are globally defined and continuously enumerated, i.e., the ID is element of [0,#machines-1].
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.
id | Machine identifier | |
name | Machine name | |
num_nodes | Expected number of nodes |
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.
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.
index | Index of the requested node |
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.
![]() |
Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre |