perun.monitoring.subprocess¶
Perun subprocess module.
Attributes¶
Functions¶
|
Prepare sensors for monitoring. |
|
Create a data node from the sensor data. |
|
Parallel function that samples energy values from hardware libraries. |
Module Contents¶
- perun.monitoring.subprocess.prepSensors(backends: Dict[str, perun.backend.Backend], l_assigned_sensors: Dict[str, Tuple]) Tuple[perun.data_model.measurement_type.MetricMetaData, List[perun.data_model.sensor.Sensor]][source]¶
Prepare sensors for monitoring.
- Parameters:
backends (Dict[str, Backend]) – A dictionary of backends.
l_assigned_sensors (Dict[str, Tuple]) – A dictionary of sensor configurations.
- Returns:
A tuple containing the following: - timesteps (List[int]): A list of timesteps. - t_metadata (MetricMetaData): Metadata for the metrics. - rawValues (List[List[Number]]): A list of raw sensor values. - lSensors (List[Sensor]): A list of sensors.
- Return type:
Tuple[List[int], MetricMetaData, List[List[Number]], List[Sensor]]
- perun.monitoring.subprocess.createNode(timesteps: List[int], t_metadata: perun.data_model.measurement_type.MetricMetaData, rawValues: List[List[perun.data_model.measurement_type.Number]], lSensors: List[perun.data_model.sensor.Sensor], perunConfig: configparser.ConfigParser) perun.data_model.data.DataNode[source]¶
Create a data node from the sensor data.
- Parameters:
timesteps (List[int]) – A list of timesteps.
t_metadata (MetricMetaData) – Metadata for the metrics.
rawValues (List[List[Number]]) – A list of raw sensor values.
lSensors (List[Sensor]) – A list of sensors.
perunConfig (ConfigParser) – The perun configuration.
- Returns:
A data node.
- Return type:
- perun.monitoring.subprocess.perunSubprocess(queue: multiprocessing.Queue, rank: int, l_assigned_sensors: Dict[str, Tuple], perunConfig: configparser.ConfigParser, sp_ready_event: multiprocessing.synchronize.Event, start_event: multiprocessing.synchronize.Event, stop_event: multiprocessing.synchronize.Event, close_event: multiprocessing.synchronize.Event, sampling_period: float) None[source]¶
Parallel function that samples energy values from hardware libraries.
- Parameters:
queue (Queue) – Multiprocessing Queue object where the results are sent after finish
rank (int) – Local MPI Rank
l_assigned_sensors (Dict[str, Tuple]) – Local MPI rank sensor configuration
perunConfig (ConfigParser) – Global perun configuration
sp_ready_event (EventClass) – Indicates monitoring supbrocess is ready, multiprocessing module
start_event (EventClass) – Indicates start of the monitored application
stop_event (EventClass) – Indicates the stop of a monitored application
close_event (EventClass) – Indicates that perun is closing, and the subprocess needs to close
sampling_period (float) – Sampling period in seconds