perun.backend ============= .. py:module:: perun.backend .. autoapi-nested-parse:: Backend module. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/perun/backend/backend/index /autoapi/perun/backend/nvml/index /autoapi/perun/backend/powercap_rapl/index /autoapi/perun/backend/psutil/index /autoapi/perun/backend/rocmsmi/index Attributes ---------- .. autoapisummary:: perun.backend.available_backends Classes ------- .. autoapisummary:: perun.backend.Backend perun.backend.NVMLBackend perun.backend.PowercapRAPLBackend perun.backend.PSUTILBackend perun.backend.ROCMBackend Package Contents ---------------- .. py:class:: Backend Abstract backend class. .. py:attribute:: id :type: str :value: 'abstract_backend' .. py:attribute:: name :type: str :value: 'Abstract backend class' .. py:attribute:: description :type: str :value: 'Abstract backend class description' .. py:attribute:: devices :type: dict .. py:property:: metadata :type: dict Return backend metadata. .. py:method:: availableSensors() -> dict[str, tuple] :abstractmethod: 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. :rtype: dict[tuple[str]] .. py:method:: getSensors(deviceList: set[str]) -> list[perun.data_model.sensor.Sensor] :abstractmethod: Return device objects based on the provided list of device ids. :param deviceList: List with wanted device ids :type deviceList: set[str] :returns: List of device objects :rtype: list[Sensor] .. py:method:: close() -> None :abstractmethod: Clean up and close backend related activities. .. py:method:: setup() -> None :abstractmethod: Perform backend setup. .. py:class:: NVMLBackend Bases: :py:obj:`perun.backend.backend.Backend` NVMLSource class. Setups connection to NVML and creates relevant devices .. py:attribute:: id :value: 'nvlm' .. py:attribute:: name :value: 'NVIDIA ML' .. py:attribute:: description :type: str :value: 'Access GPU information from NVML python bindings' .. py:method:: setup() -> None Init pynvml and gather number of devices. .. py:method:: close() -> None Backend shutdown code. .. py:method:: availableSensors() -> dict[str, tuple] 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. :rtype: dict[str, tuple] .. py:method:: getSensors(deviceList: set[str]) -> list[perun.data_model.sensor.Sensor] Gather sensor object based on a set of device ids. :param deviceList: Set containing divice ids. :type deviceList: set[str] :returns: List with Sensor objects. :rtype: list[Sensor] .. py:class:: PowercapRAPLBackend Bases: :py:obj:`perun.backend.backend.Backend` Powercap 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 .. py:attribute:: id :value: 'powercap_rapl' .. py:attribute:: name :value: 'Powercap RAPL' .. py:attribute:: description :value: 'Reads energy usage from CPUs and DRAM using Powercap RAPL' .. py:method:: setup() -> None Check Intel RAPL access. .. py:method:: close() -> None Backend shutdown code (does nothing for intel rapl). .. py:method:: availableSensors() -> dict[str, tuple] Return string id set of visible devices. :returns: Set with visible device ids. :rtype: set[str] .. py:method:: getSensors(deviceList: set[str]) -> list[perun.data_model.sensor.Sensor] Gather device objects based on a set of device ids. :param deviceList: Set of device ids. :type deviceList: set[str] :returns: Device objects. :rtype: list[Sensor] .. py:class:: PSUTILBackend Bases: :py:obj:`perun.backend.backend.Backend` PSUTIL Backend class. .. py:attribute:: id :type: str :value: 'psutil' .. py:attribute:: name :type: str :value: 'PSUTIL' .. py:attribute:: description :type: str :value: 'Obtain hardware data from psutil' .. py:method:: setup() -> None Configure psutil backend. .. py:method:: close() -> None Close backend. .. py:method:: availableSensors() -> Dict[str, Tuple] Return a dictionary with all available sensors. :returns: Dictionary with device ids and measurement unit. :rtype: Dict[str, Tuple] .. py:method:: getSensors(deviceList: Set[str]) -> List[perun.data_model.sensor.Sensor] Return desired device objects. .. py:class:: ROCMBackend Bases: :py:obj:`perun.backend.backend.Backend` ROCMBackend. Initialises sensors to get data from AMD GPUs. .. py:attribute:: id :value: 'amdsmi' .. py:attribute:: name :value: 'AMD ROCM' .. py:attribute:: description :type: str :value: 'Access GPU information from amd-smi python bindings.' .. py:method:: setup() -> None Init rocm object. .. py:method:: close() -> None Backend cleanup. .. py:method:: availableSensors() -> dict[str, tuple] 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. :rtype: dict[str, tuple] .. py:method:: getSensors(deviceList: set[str]) -> list[perun.data_model.sensor.Sensor] Gather sensor object based on a set of device ids. :param deviceList: Set containing divice ids. :type deviceList: set[str] :returns: List with Sensor objects. :rtype: list[Sensor] .. py:data:: available_backends :type: dict[str, Type[backend.Backend]]