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]) – List of timesteps.
t_metadata (MetricMetaData) – Metadata for the metrics.
rawValues (list[list[Number]]) – 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, live_callback_inits: dict[str, Callable[[], Callable[[dict[str, perun.data_model.measurement_type.Number]], None]]]) 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
live_callback_inits (dict[str, Callable[[], Callable[[str, Number], None]]]) – Dictionary of live callback initializers, where the key is the name of the callback and the value is a function that returns a callable that accepts metric identifier and value.