Version: 9.15.0
KERNEL_PY.salome_psutil Namespace Reference

Functions

def getNumberOfCPUCores ()
 
def loadOfCPUCores (script=None)
 
def getTotalPhysicalMemory ()
 
def getTotalPhysicalMemoryInUse ()
 
def getTotalPhysicalMemoryInUseByMe ()
 

Function Documentation

◆ getNumberOfCPUCores()

def KERNEL_PY.salome_psutil.getNumberOfCPUCores ( )
Get number of CPU cores in the calculation node.
:return Number of cores

Referenced by KERNEL_PY.salome_psutil.loadOfCPUCores().

◆ getTotalPhysicalMemory()

def KERNEL_PY.salome_psutil.getTotalPhysicalMemory ( )
Get total physical memory of the calculation node.
:return Size of physical memory, in megabytes.

◆ getTotalPhysicalMemoryInUse()

def KERNEL_PY.salome_psutil.getTotalPhysicalMemoryInUse ( )
Get used physical memory of the calculation node.
:return Size of used physical memory, in megabytes.

◆ getTotalPhysicalMemoryInUseByMe()

def KERNEL_PY.salome_psutil.getTotalPhysicalMemoryInUseByMe ( )
Get physical memory occupied by the current process.
:return Size of physical memory, used by current process, in megabytes.

◆ loadOfCPUCores()

def KERNEL_PY.salome_psutil.loadOfCPUCores (   script = None)
Get a load of each CPU core in the calculation node.

A script to compute loads can be customized via `script` parameter.
In that case, the script must either set `cpu_loads` variable (which
should be of list type), or specify `getCPULoads()` function returning
list as result. In both cases, the list's size must be equal to the value
returning by method `getNumberOfCPUCores()`, and each value in this list
must be in range [0, 1], otherwise exception is raised.

If `script` is not specified, default implementation is used.

:param script Custom script to calculate loads
:return List that contains loads of each CPU core.

References SalomeOnDemandTK.extension_utilities.format, and KERNEL_PY.salome_psutil.getNumberOfCPUCores().