perun.backend¶
Backend module.
Submodules¶
Attributes¶
Classes¶
Abstract backend class. |
|
NVMLSource class. |
|
Powercap RAPL as a source of cpu and memory devices. |
|
PSUTIL Backend class. |
|
ROCMBackend. |
Package Contents¶
- class perun.backend.Backend[source]¶
Abstract backend class.
- id: str = 'abstract_backend'¶
- name: str = 'Abstract backend class'¶
- description: str = 'Abstract backend class description'¶
- devices: dict¶
- property metadata: dict¶
Return backend metadata.
- abstractmethod availableSensors() dict[str, tuple][source]¶
Return a dictionary with all available sensors. Each entry contains the backend id and type of sensor.
- Returns:
Dictionary with device ids and measurement unit.
- Return type:
dict[tuple[str]]
- abstractmethod getSensors(deviceList: set[str]) list[perun.data_model.sensor.Sensor][source]¶
Return device objects based on the provided list of device ids.
- Parameters:
deviceList (set[str]) – List with wanted device ids
- Returns:
List of device objects
- Return type:
list[Sensor]
- class perun.backend.NVMLBackend[source]¶
Bases:
perun.backend.backend.BackendNVMLSource class.
Setups connection to NVML and creates relevant devices
- id = 'nvlm'¶
- name = 'NVIDIA ML'¶
- description: str = 'Access GPU information from NVML python bindings'¶
- availableSensors() dict[str, tuple][source]¶
Return a dictionary with all available sensors.
Each entry contains the backend id and type of sensor.
- Returns:
Dictionary with device ids and measurement unit.
- Return type:
dict[str, tuple]
- getSensors(deviceList: set[str]) list[perun.data_model.sensor.Sensor][source]¶
Gather sensor object based on a set of device ids.
- Parameters:
deviceList (set[str]) – Set containing divice ids.
- Returns:
List with Sensor objects.
- Return type:
list[Sensor]
- class perun.backend.PowercapRAPLBackend[source]¶
Bases:
perun.backend.backend.BackendPowercap RAPL as a source of cpu and memory devices.
Uses the powercap filesystem files to gather device information and creates metrics for each available device
- id = 'powercap_rapl'¶
- name = 'Powercap RAPL'¶
- description = 'Reads energy usage from CPUs and DRAM using Powercap RAPL'¶
- availableSensors() dict[str, tuple][source]¶
Return string id set of visible devices.
- Returns:
Set with visible device ids.
- Return type:
set[str]
- getSensors(deviceList: set[str]) list[perun.data_model.sensor.Sensor][source]¶
Gather device objects based on a set of device ids.
- Parameters:
deviceList (set[str]) – Set of device ids.
- Returns:
Device objects.
- Return type:
list[Sensor]
- class perun.backend.PSUTILBackend[source]¶
Bases:
perun.backend.backend.BackendPSUTIL Backend class.
- id: str = 'psutil'¶
- name: str = 'PSUTIL'¶
- description: str = 'Obtain hardware data from psutil'¶
- availableSensors() Dict[str, Tuple][source]¶
Return a dictionary with all available sensors.
- Returns:
Dictionary with device ids and measurement unit.
- Return type:
Dict[str, Tuple]
- getSensors(deviceList: Set[str]) List[perun.data_model.sensor.Sensor][source]¶
Return desired device objects.
- class perun.backend.ROCMBackend[source]¶
Bases:
perun.backend.backend.BackendROCMBackend.
Initialises sensors to get data from AMD GPUs.
- id = 'amdsmi'¶
- name = 'AMD ROCM'¶
- description: str = 'Access GPU information from amd-smi python bindings.'¶
- availableSensors() dict[str, tuple][source]¶
Return a dictionary with all available sensors.
Each entry contains the backend id and type of sensor.
- Returns:
Dictionary with device ids and measurement unit.
- Return type:
dict[str, tuple]
- getSensors(deviceList: set[str]) list[perun.data_model.sensor.Sensor][source]¶
Gather sensor object based on a set of device ids.
- Parameters:
deviceList (set[str]) – Set containing divice ids.
- Returns:
List with Sensor objects.
- Return type:
list[Sensor]
- perun.backend.available_backends: dict[str, Type[backend.Backend]]¶