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.createNode perun.monitoring.subprocess.perunSubprocess Module Contents --------------- .. py:data:: log .. py:function:: 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]] Prepare sensors for monitoring. :param backends: A dictionary of backends. :type backends: dict[str, Backend] :param l_assigned_sensors: A dictionary of sensor configurations. :type l_assigned_sensors: dict[str, tuple] :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. :rtype: tuple[list[int], MetricMetaData, list[list[Number]], list[Sensor]] .. py:function:: 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 Create a data node from the sensor data. :param timesteps: List of timesteps. :type timesteps: list[int] :param t_metadata: Metadata for the metrics. :type t_metadata: MetricMetaData :param rawValues: List of raw sensor values. :type rawValues: list[list[Number]] :param lSensors: A list of sensors. :type lSensors: list[Sensor] :param perunConfig: The perun configuration. :type perunConfig: ConfigParser :returns: A data node. :rtype: DataNode .. py:function:: 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 Parallel function that samples energy values from hardware libraries. :param queue: Multiprocessing Queue object where the results are sent after finish :type queue: Queue :param rank: Local MPI Rank :type rank: int :param l_assigned_sensors: Local MPI rank sensor configuration :type l_assigned_sensors: Dict[str, Tuple] :param perunConfig: Global perun configuration :type perunConfig: ConfigParser :param sp_ready_event: Indicates monitoring supbrocess is ready, multiprocessing module :type sp_ready_event: EventClass :param start_event: Indicates start of the monitored application :type start_event: EventClass :param stop_event: Indicates the stop of a monitored application :type stop_event: EventClass :param close_event: Indicates that perun is closing, and the subprocess needs to close :type close_event: EventClass :param sampling_period: Sampling period in seconds :type sampling_period: float :param live_callback_inits: 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. :type live_callback_inits: dict[str, Callable[[], Callable[[str, Number], None]]]