# scope_profiler.plotting_scripts.likwid

*module*

LIKWID hardware-counter bar charts.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/likwid.py#L1-L1)

## scope_profiler.plotting_scripts.likwid.available_likwid_metrics

*function*

```python
def available_likwid_metrics(profiling_data: ProfilingResults | Sequence[ProfilingResults]) -> list[str]
```

List the LIKWID metric/event names available for :func:`plot_likwid`.

Union over every run, rank and region, in the order LIKWID reported them
(derived metrics first, then raw events) - so a caller who does not know
what a run measured can list the valid ``metric`` values before plotting.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/likwid.py#L24-L43)

## scope_profiler.plotting_scripts.likwid.plot_likwid

*function*

```python
def plot_likwid(profiling_data: ProfilingResults | Sequence[ProfilingResults], metric: str, ranks: list[int] | int | None = None, include: list[str] | str | None = None, exclude: list[str] | str | None = None, labels: Sequence[str] | None = None, filepath: str | None = None, show: bool = False, verbose: bool = True, cmap: str = DEFAULT_CMAP, log_scale: bool = False, data_filepath: str | Path | None = None, data_format: str = 'csv', backend: str = 'matplotlib') -> None
```

Plot one LIKWID derived metric or raw event, grouped by region and rank.

LIKWID counters are otherwise only visible as text tables
(:func:`~scope_profiler.summary.print_likwid_tables`); this gives the same
numbers a bar chart, one group of bars per region and one bar per rank, so
a metric like memory bandwidth or CPI can be compared across regions (or
across files, for a single rank) the same way :func:`plot_durations`
compares timings.

Parameters
----------
metric : str
    Name of a LIKWID derived metric (e.g. ``"CPI"``) or raw event/event
    label (e.g. ``"CAS_COUNT_RD"``). See :func:`available_likwid_metrics`
    for the names a run actually recorded.
backend : str
    Backend to use for rendering: "matplotlib" (default) or "plotly".

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/plotting_scripts/likwid.py#L87-L252)
