Skip to content

CPU and FNL agree run by run ​

IDGroupMilestoneBackendsFigureRegression
VV agreeDissipative terms (M4)M4 (#65)CPU, FNLno—

Case and scope ​

Every run of the VV legs on the CPU against the same run on FNL, cell by cell on the last checkpoint.

What the case catches: the legs pass on both backends, but a pass bounds an error norm, and two backends can pass with different fields. Every dissipative kernel exists twice, as a CPU loop and an FNL device kernel (OpenACC, or OpenMP offload), so the same run on both must give the same state up to the round-off of the operation order. A device kernel that differs from its CPU twin in a term below the oracle's resolution shows here.

Models and numerics ​

ItemChoiceCode
CPU dissipative kernelsNavier–Stokes and Ohmic fluxes, orders 2 and 4add_dissipative_fluxes_o2, add_dissipative_fluxes_o4, add_resistive_fluxes_o2, add_resistive_fluxes_o4, adam_flume_cpu_dissipation_kernels.F90
FNL dissipative kernelsthe device twinsadd_dissipative_fluxes_o2_dev, add_dissipative_fluxes_o4_dev, add_resistive_fluxes_o2_dev, add_resistive_fluxes_o4_dev, adam_flume_fnl_dissipation_kernels.F90; add_dissipative_fluxes_dev, adam_flume_fnl_object.F90
Comparisonblocks matched by their origin (rank independent); each difference divided by the physical scale of its variable, not by its own maximumagree, src/tests/flume/verification/viscous/waves.py

The scales: density and energy by their maximum; the momentum by the larger of its maximum and ρ0a0 (an Ohmic wave at rest carries momentum of O(A2), far below the round-off of the state); the field by its maximum (it is the signal); ψ by chmax|B|.

Initial and boundary conditions ​

The runs of the legs, unchanged: 72 runs, every resolution of every ladder, the −A twins, the ideal twins and both sides of each forest, on 2 ranks, one clean build of each backend. The setups are on the case pages:

LegRunsSetup
VV-1 shear12viscous waves
VV-2 acoustic6viscous waves
VV-3 Couette3Couette
VV-4 Becker6Becker
VV-5 Ohmic, Alfvén, acoustic on MHD18Ohmic decay
VV-6 Ohmic budget4Ohmic heating
VV-7 conservation6seam conservation
VV-7 forests8seam conservation
VV-8 seams9seam accuracy

Input files ​

FileRole
src/tests/flume/verification/viscous/check.sh --legs agreeruns nothing: pairs every work-adam_flume_cpu-np2-* directory with its work-adam_flume_fnl-np2-* twin, after every leg has run on both executables
src/tests/flume/verification/viscous/waves.py agreethe cell-by-cell comparison
bash
cd src/tests/flume/verification/viscous
./check.sh && FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh && ./check.sh --legs agree

No figure: a run-by-run identity has nothing a plot would show (#85).

Results ​

Bound: 10−10 on every run.

LegRunsLargest difference
VV-1 shear122.7⋅10−14
VV-2 acoustic64.9⋅10−15
VV-3 Couette31.4⋅10−13
VV-4 Becker64.3⋅10−13
VV-5 Ohmic, Alfvén, acoustic on MHD184.7⋅10−14
VV-6 Ohmic budget45.3⋅10−15
VV-7 conservation69.3⋅10−15
VV-7 forests83.4⋅10−14
VV-8 seams98.4⋅10−14

The DC contract passes on both backends as well.

Related cases: the Sod tube shows the same CPU–FNL round-off agreement on the inviscid path (Sod).

Findings ​

  • The largest differences sit in the Becker shock, the steepest gradients of the suite, at 4⋅10−13 of the momentum scale: no run differs by more than a few hundred units of round-off.