Opens a larger view. Escape closes it.

hardware-counters

check_weak.py

"""
Is the 'weak-scaled' Cirrus dataset actually weak-scaled?

Under ideal weak scaling, work per rank is constant so runtime should be flat
in core count. An agent reports HPL runtime rising 39x from 1 to max cores,
which would make the label indefensible. Verify per application.
"""
import os
import numpy as np, pandas as pd

D = os.environ.get("DISS_ROOT", "/work/project/project/user")
df = pd.read_csv(f"{D}/data/cirrus_weak.csv")
df = df[df.runtime_s > 0]

g = (df.groupby(["app", "base", "ncore"]).runtime_s.median().reset_index())

print("runtime at max cores / runtime at min cores, per app (largest base)")
print("ideal weak scaling = 1.0 (flat); large values mean work per rank GREW\n")
print(f"{'app':9s} {'base':>8s} {'min core':>9s} {'max core':>9s} "
      f"{'t_min':>8s} {'t_max':>8s} {'ratio':>7s}")
print("-" * 62)
for app in sorted(g.app.unique()):
    sub = g[g.app == app]
    b = sub.base.max()
    s = sub[sub.base == b].sort_values("ncore")
    if len(s) < 2:
        continue
    lo, hi = s.iloc[0], s.iloc[-1]
    print(f"{app:9s} {int(b):>8d} {int(lo.ncore):>9d} {int(hi.ncore):>9d} "
          f"{lo.runtime_s:8.2f} {hi.runtime_s:8.2f} "
          f"{hi.runtime_s/max(lo.runtime_s,1e-9):7.2f}")

print("\nverdict: entries far from 1.0 are NOT weak scaling. The sizes were")
print("rescaled so total work grows with rank count, which lifts runs off the")
print("sub-second floor, but that is 'rescaled', not 'weak-scaled'.")