perun.processing

Processing Module.

Attributes

log

Functions

processEnergyData(raw_data[, start, end]) → tuple[Any, Any]

Calculate total energy and average power from an energy or power time series.

processIOData(raw_data[, start, end]) → tuple[Any, Any]

Calculate total bytes and average bandwidth from a byte counter series.

processSensorData(sensorData) → perun.data_model.data.DataNode

Calculate metrics based on raw values.

processDataNode(dataNode, perunConfig[, force_process]) → perun.data_model.data.DataNode

Recursively calculate metrics on the dataNode tree.

processRegionsWithSensorData(regions, dataNode) → None

Complete region information using sensor data found on the data node (in place op).

addRunAndRuntimeInfoToRegion(region) → None

Process run and runtime stats in region objects (in place operation).

getInterpolatedValues(t, x, start, end) → tuple[numpy.typing.NDArray[numpy.floating], numpy.typing.NDArray[numpy.floating]]

Extract a time range out of a time series, and interpolate the values at the edges.

Module Contents

perun.processing.log[source]
perun.processing.processEnergyData(raw_data: perun.data_model.data.RawData, start: perun.data_model.measurement_type.Number | None = None, end: perun.data_model.measurement_type.Number | None = None) → tuple[Any, Any][source]

Calculate total energy and average power from an energy or power time series.

Using the start and end parameters the results can be limited to certain areas of the application run.

Parameters:
  • raw_data (RawData) – Raw Data from sensor

  • start (Optional[Number], optional) – Start time of region, by default None

  • end (Optional[Number], optional) – End time of region, by default None

Returns:

Tuple with total energy in joules and avg power in watts.

Return type:

_type_

perun.processing.processIOData(raw_data: perun.data_model.data.RawData, start: perun.data_model.measurement_type.Number | None = None, end: perun.data_model.measurement_type.Number | None = None) → tuple[Any, Any][source]

Calculate total bytes and average bandwidth from a byte counter series.

Network and disk IO sensors report a cumulative byte counter. The raw counter values on their own are not very useful, so this function converts them into an IO bandwidth (bytes per second) series, in the same spirit as processEnergyData(), which turns an energy counter into a power series.

Just like processEnergyData(), when the input is a cumulative byte counter (unit BYTE) this function mutates raw_data in place: the original cumulative counter is stored in raw_data.alt_values / raw_data.alt_v_md and raw_data.values / raw_data.v_md are replaced with the bandwidth series (unit BYTES_PER_SECOND).

Using the start and end parameters the results can be limited to certain areas of the application run.

Parameters:
  • raw_data (RawData) – Raw data from a cumulative byte counter sensor.

  • start (Optional[Number], optional) – Start time of region, by default None

  • end (Optional[Number], optional) – End time of region, by default None

Returns:

Tuple with the total number of bytes transferred and the average bandwidth in bytes per second.

Return type:

tuple[Any, Any]

perun.processing.processSensorData(sensorData: perun.data_model.data.DataNode) → perun.data_model.data.DataNode[source]

Calculate metrics based on raw values.

Parameters:

sensorData (DataNode) – DataNode with raw sensor data.

Returns:

DataNode with computed metrics.

Return type:

DataNode

perun.processing.processDataNode(dataNode: perun.data_model.data.DataNode, perunConfig: configparser.ConfigParser, force_process: bool = False) → perun.data_model.data.DataNode[source]

Recursively calculate metrics on the dataNode tree.

Parameters:
  • dataNode (DataNode) – Root data node tree.

  • perunConfig (ConfigParser) – Perun configuration

  • force_process (bool, optional) – Force recomputation of child node metrics, by default False

Returns:

Data node with computed metrics.

Return type:

DataNode

perun.processing.processRegionsWithSensorData(regions: list[perun.data_model.data.Region], dataNode: perun.data_model.data.DataNode) → None[source]

Complete region information using sensor data found on the data node (in place op).

Parameters:
  • regions (List[Region]) – List of regions that use the same data node.

  • dataNode (DataNode) – Data node with sensor data.

Return type:

None

perun.processing.addRunAndRuntimeInfoToRegion(region: perun.data_model.data.Region) → None[source]

Process run and runtime stats in region objects (in place operation).

Parameters:

region (Region) – Region object

Return type:

None

perun.processing.getInterpolatedValues(t: numpy.typing.NDArray[numpy.floating], x: numpy.typing.NDArray[numpy.floating], start: perun.data_model.measurement_type.Number, end: perun.data_model.measurement_type.Number) → tuple[numpy.typing.NDArray[numpy.floating], numpy.typing.NDArray[numpy.floating]][source]

Extract a time range out of a time series, and interpolate the values at the edges.

Parameters:
  • t (np.ndarray) – Original time steps

  • x (np.ndarray) – Original values

  • start (Number) – Start of the roi

  • end (Number) – End of the roi

Returns:

Tuple with the new time steps and values.

Return type:

Tuple[np.ndarray, np.ndarray]