#include <Process.h>
Public Member Functions | |
Constructors & destructor | |
Process (ident_t id, const std::string &name) | |
Get & set process information | |
uint32_t | num_threads () const |
Thread * | get_thread (uint32_t index) const |
void | add_thread (Thread *thread) |
Node * | get_node () const |
The numerical identifiers of the individual processes are globally defined and continuously enumerated, i.e., the ID is element of [0,#processes-1]. In the context of MPI applications, the identifier of a process is equal to its rank number in MPI_COMM_WORLD.
Creates a new instance and sets its identifier and name to the given values id and name, respectively.
Right after the initialization, the process is not associated with any node. Likewise, there are no threads bound to the process.
id | Process identifier | |
name | Process name |
void add_thread | ( | Thread * | thread | ) |
Adds the given thread to the list of threads running within this process. If thread is already associated to the process, the call is silently ignored. In addition, the process pointer of the thread is updated.
thread | New thread object |
Node * get_node | ( | ) | const |
Returns the node this process is running on. If the process has not been added to a node yet, a NULL pointer is returned.
Thread * get_thread | ( | uint32_t | index | ) | const |
Returns a pointer to the associated thread with the given index. These indices are local to this process (i.e., index must be an element of [0,num_threads()-1]) and correspond to the thread IDs, provided that all threads have already been added to the process.
index | Index (ID) of the requested thread |
RuntimeError | if an invalid index is given ("Index out of bounds") |
uint32_t num_threads | ( | ) | const |
Returns the number of threads running within this process.
![]() |
Copyright © 1998–2009 Forschungszentrum Jülich, Jülich Supercomputing Centre |