npu.utils.sys_utils
Classes
|
- class npu.utils.sys_utils.SysUtils
- Author:
Alberto M. Esmoris Pena
Class with util static methods related to the system where the NAIPS framework is run.
- static get_sys_mem()
Obtain the system memory, in bytes.
- Returns:
System memory, in bytes.
- Return type:
int
- static get_self_allocated_mem()
Obtain the memory allocated by the calling process, in kilobytes.
- Returns:
Memory allocated by the calling process, in kilobytes.
- Return type:
int
- static get_sys_threads()
Obtain the maximum number of parallel threads.
- Returns:
Maximum number of parallel threads.
- Return type:
int
- static validate_requested_threads(nthreads, warning=True, raise_exception=False, caller='CALLER')
Validate that the number of threads (nthreads) is not greater than the number of available threads.
- Parameters:
nthreads (int) – The number of threads.
warning (bool) – Flag to control whether to emit a warning message through the logging system (True) or not (False).
raise_exception (bool) – Flag to control whether to raise a exception when
caller (str or class) – The method’s caller. It can be either the name or the class.
- static free_memory(report=False)
Explicitly release memory resources.
- Parameters:
report (bool) – Whether to report the status of the system’s memory after releasing it (True) or not (False).
- Returns:
Nothing at all.