perun.monitoring.subprocess

Perun subprocess module.

Attributes

log

Functions

prepSensors(→ Tuple[List[int], ...)

Prepare sensors for monitoring.

_monitoringLoop(lSensors, timesteps, rawValues, ...)

createNode(→ perun.data_model.data.DataNode)

Create a data node from the sensor data.

perunSubprocess(queue, rank, backends, ...)

Parallel function that samples energy values from hardware libraries.

Module Contents

perun.monitoring.subprocess.log
perun.monitoring.subprocess.prepSensors(backends: Dict[str, perun.backend.backend.Backend], l_assigned_sensors: Dict[str, Tuple]) Tuple[List[int], perun.data_model.measurement_type.MetricMetaData, List[List[numpy.number]], List[perun.data_model.sensor.Sensor]]

Prepare sensors for monitoring.

Parameters

backendsDict[str, Backend]

A dictionary of backends.

l_assigned_sensorsDict[str, Tuple]

A dictionary of sensor configurations.

Returns

Tuple[List[int], MetricMetaData, List[List[np.number]], List[Sensor]]

A tuple containing the following: - timesteps (List[int]): A list of timesteps. - t_metadata (MetricMetaData): Metadata for the metrics. - rawValues (List[List[np.number]]): A list of raw sensor values. - lSensors (List[Sensor]): A list of sensors.

perun.monitoring.subprocess._monitoringLoop(lSensors: List[perun.data_model.sensor.Sensor], timesteps: List[int], rawValues: List[List[numpy.number]], stopCondition: Callable[[float], bool])
perun.monitoring.subprocess.createNode(timesteps: List[int], t_metadata: perun.data_model.measurement_type.MetricMetaData, rawValues: List[List[numpy.number]], lSensors: List[perun.data_model.sensor.Sensor], perunConfig: configparser.ConfigParser) perun.data_model.data.DataNode

Create a data node from the sensor data.

Parameters

timestepsList[int]

A list of timesteps.

t_metadataMetricMetaData

Metadata for the metrics.

rawValuesList[List[np.number]]

A list of raw sensor values.

lSensorsList[Sensor]

A list of sensors.

perunConfigConfigParser

The perun configuration.

Returns

DataNode

A data node.

perun.monitoring.subprocess.perunSubprocess(queue: multiprocessing.Queue, rank: int, backends: Dict[str, perun.backend.backend.Backend], l_assigned_sensors: Dict[str, Tuple], perunConfig: configparser.ConfigParser, sp_ready_event, start_event, stop_event, sampling_period: float)

Parallel function that samples energy values from hardware libraries.

Parameters

queueQueue

Multiprocessing Queue object where the results are sent after finish

rankint

Local MPI Rank

backendsList[Backend]

Available backend list

l_assigned_sensorsDict[str, Tuple]

Local MPI rank sensor configuration

sp_ready_event_type_

Indicates monitoring supbrocess is ready, multiprocessing module

start_event_type_

Indicates app start, multiprocessing module

stop_event_type_

Indicates app stop, multiprocessing module

sampling_periodfloat

Sampling period in seconds