casacore
|
#include <HostInfo.h>
Static Public Member Functions | |
static String | hostName () |
static Int | processID () |
static Double | secondsFrom1970 () |
static Bool | bigEndian () |
Returns True for big endian machines (like SUN). More... | |
static Int | numCPUs (bool use_aipsrc=false) |
Returns 0 if unable to determine the number of CPUs. More... | |
static ptrdiff_t | memoryTotal (bool use_aipsrc=false) |
Get memory info (in KBytes). More... | |
static ptrdiff_t | memoryUsed () |
static ptrdiff_t | memoryFree () |
static ptrdiff_t | swapTotal () |
Get swap space info (in KBytes). More... | |
static ptrdiff_t | swapUsed () |
static ptrdiff_t | swapFree () |
static ptrdiff_t | setMemoryTotal (ptrdiff_t memory) |
Allows to set custom resource values overriding the existing.apisrc setting and/or system defaults Expected unit are KiB for memory total and percentage (%) for memory fraction Returns the value previously stored. More... | |
static Int | setMemoryFraction (Int memfrac) |
static Int | setNumCPUs (Int numCPUs) |
Private Member Functions | |
HostInfo () | |
we don't want folks creating these... More... | |
const HostInfo & | operator= (const HostInfo &) |
Static Private Attributes | |
static HostMachineInfo * | info |
static ptrdiff_t | resources_memory |
static Int | resources_memfrac |
static Int | resources_numCPUs |
Miscellaneous information about this host and process.
Public interface
This class is meant to encapsulate miscellaneous information about the environment that the current process is running in.
At present, the class can be used to obtain the name of the host on which this process is running, the process id of this process, the amount of physical memory (total, used, & free) on this host, the amount of swap space (total, used, and free), the number of CPUs on this host, and a count of the number of seconds from January 1, 1970. Generally you should use the classes Time and MVTime if your primary interest is related to time and dates. If your interest is in timing, you would generally use class Timer, which can also report CPU times as well as "clock" times.
Determination of the number of CPUs, swap space, and physical memory is particularly OS dependent. In cases where this functionality has not yet been implemented, the memory and swap functions will return -1 and the CPU function will return 0.
The ObjectID class uses a combination of hostname, process id, time, and a sequence number to ensure that ObjectID's are distinct. This class encapsulates the way the first three of those items are obtained.
Definition at line 103 of file HostInfo.h.
|
private |
we don't want folks creating these...
|
inlinestatic |
Returns True for big endian machines (like SUN).
Returns False for little endian machines (like PC).
Definition at line 157 of file HostInfo.h.
References casacore::False, and casacore::True.
|
static |
|
static |
|
static |
Get memory info (in KBytes).
Returns -1 if unable to determine memory info.
|
static |
|
static |
Returns 0 if unable to determine the number of CPUs.
|
static |
|
static |
|
static |
Allows to set custom resource values overriding the existing.apisrc setting and/or system defaults Expected unit are KiB for memory total and percentage (%) for memory fraction Returns the value previously stored.
|
static |
|
static |
Get swap space info (in KBytes).
Returns -1 if unable to determine swap info.
|
static |
|
staticprivate |
Definition at line 150 of file HostInfo.h.
|
staticprivate |
Definition at line 152 of file HostInfo.h.
|
staticprivate |
Definition at line 151 of file HostInfo.h.
|
staticprivate |
Definition at line 153 of file HostInfo.h.