|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
Query basic system information. More...
#include <system_info.hpp>
Public Member Functions | |
| virtual | ~SystemInfo () noexcept=default |
| Virtual destructor. More... | |
| virtual std::string | pid () const |
| Get the current process ID. More... | |
| virtual std::string | host_name () const |
| Get the host name for this process. More... | |
| virtual int | mpi_rank () const |
| Get the MPI rank of this process. More... | |
| virtual int | mpi_size () const |
| Get the size of the MPI universe in which this process is participating. More... | |
| virtual std::string | env_variable_value (std::string const &var_name) const |
| Get the value of the given variable from the environment. More... | |
Query basic system information.
The class structure here is, strictly speaking, unnecessary. It is used to provide a "hook" for stubbing this information during testing.
Definition at line 42 of file system_info.hpp.
|
virtualdefaultnoexcept |
Virtual destructor.
|
virtual |
Get the value of the given variable from the environment.
If the variable doesn't exist, the empty string is returned.
|
virtual |
Get the host name for this process.
|
virtual |
Get the MPI rank of this process.
If this is not an MPI job, or cannot be determined to be an MPI job, this will return 0.
The return type is chosen for consistency with MPI 3.0.
|
virtual |
Get the size of the MPI universe in which this process is participating.
If this is not an MPI job, or cannot be determined to be an MPI job, this will return 1.
The return type is chosen for consistency with MPI 3.0.
|
virtual |
Get the current process ID.
This returns the value as a string to avoid system differences in pid_t. However, it's probably safe to return either int64_t or uint64_t here.