RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Functions | Variables
check_machine Namespace Reference

Functions

str sha256_file (Path p)
 
dict probe ()
 
dict env ()
 
 main (argv=None)
 

Variables

 HERE = Path(__file__).resolve().parent
 
 REPO = HERE.parent.parent
 
str REF = HERE / "machine_reference.json"
 
 PROBE
 
dict PRECOND = {"full_system": "Woodbury", "active_window": "Jacobi"}
 
list FIELDS
 
int RTOL = 1e-6
 
dict ATOL = {"delta_FP": 1e-9, "conv_psuccess": 1e-12}
 

Detailed Description

Run this on EVERY machine before it joins the campaign.

    python check_machine.py            # compare against the committed reference
    python check_machine.py --write    # (re)generate the reference, once, on one machine

Why this exists
---------------
The C++ solver is NOT in git -- `build/` is ignored, so every machine compiles
its own from cpp_utils/.  Four machines with different compiler or SUNDIALS
versions produce numerically different results while every hash in the
provenance block still looks plausible, and merge_and_sobol would then mix them
into one Sobol estimate.  That is the same class of error as the grid
saturation this project already hit: a believable number with no validity.

So: pin one fixed configuration, run it, and compare against a reference
committed from a known-good machine.  It takes ~30 s and it is the difference
between "the four machines agree" and "the four machines were assumed to
agree".

The check deliberately uses a SMALL, FAST configuration.  It is verifying that
the toolchain agrees, not that the physics is right -- the run is expected to be
inadmissible (the grid is far too coarse), and that is fine.

Tolerance: 1e-6 relative -- the campaign's own integration rtol.  CVODE with
fixed tolerances is bit-deterministic for a FIXED BINARY, so an earlier 1e-9
bar was right as long as every machine ran the same build.  It is unreachable
across ARCHITECTURES: Windows/x86 (MSVC + MKL, /arch:AVX2) and macOS/arm64
(AppleClang + Accelerate, -march=native) reassociate and vectorise the same
reductions differently, which shows up as ~1e-7 drift on the CVODE-integrated
fields while the closed-form fields (Di_eff, Dv_eff, conv_*) still match to
0.0 exactly.  Holding the gate tighter than the integrator's own accuracy
rejects machines whose physics is identical, so the bar is set AT the
integration tolerance: anything above it is a real discrepancy, anything below
it is beneath the resolution the solver claims in the first place.
OMP_NUM_THREADS is pinned to 1 so reduction order cannot vary within a build.

Function Documentation

◆ env()

dict check_machine.env ( )

Definition at line 171 of file check_machine.py.

◆ main()

check_machine.main (   argv = None)

Definition at line 188 of file check_machine.py.

◆ probe()

dict check_machine.probe ( )

Definition at line 123 of file check_machine.py.

◆ sha256_file()

str check_machine.sha256_file ( Path  p)

Definition at line 116 of file check_machine.py.

Variable Documentation

◆ ATOL

dict check_machine.ATOL = {"delta_FP": 1e-9, "conv_psuccess": 1e-12}

Definition at line 113 of file check_machine.py.

◆ FIELDS

list check_machine.FIELDS
Initial value:
1= ["Di_eff", "Dv_eff", "conv_psuccess", "conv_psuccess_abs",
2 "N_loops_100", "N_loops_111", "mean_n_100", "mean_n_111",
3 "C_SIA_tot", "C_VAC_tot", "swelling", "delta_FP"]

Definition at line 85 of file check_machine.py.

◆ HERE

check_machine.HERE = Path(__file__).resolve().parent

Definition at line 52 of file check_machine.py.

◆ PRECOND

dict check_machine.PRECOND = {"full_system": "Woodbury", "active_window": "Jacobi"}

Definition at line 80 of file check_machine.py.

◆ PROBE

check_machine.PROBE
Initial value:
1= dict(I=300, V=480, i_mobile=10, v_mobile=5, T_K=623.15, dose=0.02,
2 rho_d=1.0e14, E_a0_conv=2.2, dH2_abs_conv=0.30, psucc_abs_pref=2.0,
3 gamma_a_conv=0.02, phi_max_junc=0.0, f_cl_i=0.25, f_cl_v=0.05,
4 rtol=1e-6, solver_mode="active_window")

Definition at line 74 of file check_machine.py.

◆ REF

str check_machine.REF = HERE / "machine_reference.json"

Definition at line 55 of file check_machine.py.

◆ REPO

check_machine.REPO = HERE.parent.parent

Definition at line 53 of file check_machine.py.

◆ RTOL

int check_machine.RTOL = 1e-6

Definition at line 88 of file check_machine.py.