perun.monitoring.subprocess =========================== .. py:module:: perun.monitoring.subprocess .. autoapi-nested-parse:: Perun subprocess module. Attributes ---------- .. autoapisummary:: perun.monitoring.subprocess.log Functions --------- .. autoapisummary:: perun.monitoring.subprocess.prepSensors perun.monitoring.subprocess._monitoringLoop perun.monitoring.subprocess.createNode perun.monitoring.subprocess.perunSubprocess Module Contents --------------- .. py:data:: log .. py:function:: 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 ---------- backends : Dict[str, Backend] A dictionary of backends. l_assigned_sensors : Dict[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. .. py:function:: _monitoringLoop(lSensors: List[perun.data_model.sensor.Sensor], timesteps: List[int], rawValues: List[List[numpy.number]], stopCondition: Callable[[float], bool]) .. py:function:: 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 ---------- 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. perunConfig : ConfigParser The perun configuration. Returns ------- DataNode A data node. .. py:function:: 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 ---------- queue : Queue Multiprocessing Queue object where the results are sent after finish rank : int Local MPI Rank backends : List[Backend] Available backend list l_assigned_sensors : Dict[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_period : float Sampling period in seconds