Skip to content
Projects

scope_profiler.report_data

Data behind the report charts and its scaling axes, without any HTML.

The HTML report and the Astro site generator both need the same chart payloads (the JSON the plot_* functions export) and the same rules for what a comparison scales over; they live here so neither depends on the other.

Attributes

NameDescription
SCALING_MODESNo description.
SPEEDUP_X_CHOICESNo description.
SPEEDUP_X_FIELDSNo description.

Classes

NameDescription
SpeedupAxisErrorThe requested speedup x-axis is unknown, or some run did not record it.

Functions

NameDescription
collect_chart_payloadsBuild the chart payloads of one run or of a comparison of runs.

SCALING_MODESattributemodule attribute#

SCALING_MODES = ('strong', 'weak', 'both')

SPEEDUP_X_CHOICESattributemodule attribute#

SPEEDUP_X_CHOICES = ('auto', *SPEEDUP_X_FIELDS)

SPEEDUP_X_FIELDSattributemodule attribute#

SPEEDUP_X_FIELDS = {
  'ranks': 'num_ranks',
  'nodes': 'num_nodes',
  'threads': 'omp_num_threads',
  'cores': 'total_cores'
}

SpeedupAxisErrorclass#

class SpeedupAxisError(ValueError)

Bases: ValueError

The requested speedup x-axis is unknown, or some run did not record it.

collect_chart_payloadsfunction#

def collect_chart_payloads(runs, include, exclude, ranks, comparison: bool = False, scaling_field: str | None = None, scaling: str = 'both', rank_charts: bool | None = None, stack_toggle: bool = False, stack_default: bool = True) -> tuple[list[tuple[str, dict, dict]], list[str]]

Build the chart payloads of one run or of a comparison of runs.

Returns (charts, failures): charts holds (title, payload, options) in display order, where payload is the JSON document a plot_* function exports and options its extra view settings (the variants of a scaling chart, a layout override); failures says why a chart is missing. Needs scope-profiler[pproc] and raises :class:ImportError without it.

A comparison keeps only the charts that compare runs; each run’s timeline and rank charts belong to its own page. scaling picks the chart(s) for runs of different sizes: “strong” the speedup, “weak” the weak-scaling efficiency, “both” the two of them.

rank_charts draws the rank imbalance and heatmap charts over the runs (default: for a single run’s report only). stack_toggle gives a single run’s durations chart the other way of drawing it, as an alternate payload, for a page whose reader can switch; stack_default=False draws the single run’s durations unstacked, in one colour, and leaves the stacked bars to that switch.