Skip to content

DKX 2.11.0

Choose a tag to compare

@rogeriojorge rogeriojorge released this 21 Oct 02:46
· 25 commits to main since this release
9144e73

Validation and robustness. dkx scan covers SFINCS scanTypes 1-5. Phi1 is
benchmarked on W7-X with an impurity, and its memory falls from 11 to 2.4 GB.
The W7-X monoenergetic gap to MONKES/yancc was a radial-normalization error in
the benchmark deck; D11* now agrees to 2e-4. Improved Sugama builds its
momentum restoring per species pair. The bootstrap current agrees with Redl to
1.5-1.8% in a tokamak and within the angular-resolution spread on precise QA
and QH. Large-E_r Fokker-Planck stalls are fixed at their cause, SuperLU memory
is calibrated, MUMPS can run out of core, and --check-grid reports whether a
result is resolved.

  • Fix: W7-X EIM D11* looked 10 to 12% apart between DKX, YANCC and MONKES because the deck's psiAHat was B0 aHat^2/2 (0.3195) instead of the equilibrium's toroidal flux (0.3032), so DKX divided by a different dpsi/dr. Corrected, and with each code's own dpsi/dr mapped by dkes_to_beidler(psi_p=...), the converged ladders agree to 7e-4 (validation/cross_code_gaps_v1.json); the sealed W7-X case is re-sealed at a 3% gate. tests/test_physics_limits.py pins D11 per psi^2 against NTX and the 1/psiAHat scaling of D11*.
  • Memory: the Phi1 bordered preconditioner no longer materializes the border (matrix-free A^-1 B only), is passed to the Krylov solve without baked-in constants, and is reused across Newton steps. W7-X 9x35x32x4, three species: 11.1 GB to 2.4 GB peak, 275 s to 115 s; 13x45x48x5: over 14 GB to 9.3 GB, 621 s (4 cores, shared host). SFINCS: about 1.3 and 5.9 GB.
  • Fix: the improved Sugama momentum-restoring response was built from the test operator summed over all background species, so electron-ion Lorentz scattering entered the electron-electron restoring shape and the like-species operator lost its shifted-Maxwellian null vector. It is now one term per ordered species pair. Spitzer-Harm conductivity deficit: 22.6 to 5.4 % before, 11.1 to 3.1 % after (Z = 1 to 16); the rest is open, since the published operator is within 1 % (Frei et al. 2022), so the field-particle part is still incomplete (tests/test_physics_limits.py).
  • dkx scan also runs SFINCS scanTypes 1 (convergence), 3 (one variable) and 4 (radius), so no repository checkout is needed, and names radius folders rN_<r> as upstream (an earlier rN<r> folder is reused).
  • Fix: the coupled preconditioner no longer stalls at large |E_r|. Its float32 apply is a fixed map only to single precision, and the wide restart window reconstructs M^-1 (V y) from the Arnoldi basis alone (no stored Z), which amplified that error: the first wide cycle ended at 80 x ||b|| on the HSX QHS full-FP deck (66,004 unknowns) and the solve stalled after 892 to 1,253 iterations. The wide window now stores Z for coupled and the wide-restart budget counts both bases. Forced coupled, E_r = 15 and 20, 4 threads of a loaded laptop (load 7 to 10): stall then escalation to coarse_triangle 60 s and 67 s (stall alone 42 s and 50 s); now 19 s and 23 s, 487 and 572 iterations, one rung. E_r = 0, 5, 10 converge before the wide window and are unchanged (5, 11, 10 s). A residual-rate test on the short windows was measured and rejected: restart-stagnant decks that converge in the wide window (coarse, Nx = 12 and 16, 79,204 and 105,604 unknowns) sit at 0.73 to 0.83 after the probe window and 0.66 after the middle one, no different from the stalled coupled solve.
  • The SuperLU peak-memory estimate is calibrated on six sizes instead of one. HSX QHS full-FP deck, E_r terms on, 4 laptop threads (load 7 to 10), whole-process peak: 19,804 / 33,004 / 39,604 (Nxi = 40) / 46,204 / 85,804 unknowns took 3.6 / 5.7 / 6.7 / 7.8 / 14.4 GB and 31 / 111 / 73 / 375 / 2,341 s, residuals 6e-15 to 4e-14; with the earlier 66,004-unknown point (9.9 GB) the fit is 1.25 x (2.04 + 8.59 (n/66,004)^1.28) GB, within 8% of every point. The old law (1.25 x 9.9 GB x (n/66,004)^1.6) was 1.3 x too high at 85,804 and 2 x too low at 19,804; it put the 633,604-unknown gap deck at 460 GB, this one at 198 GB (an extrapolation past the largest measured size). Time grows as about n^3 above 46,000.
  • SolverOptions(direct_out_of_core=True) / solve(direct_out_of_core=True): the MUMPS direct route keeps its factors on disk (needs the SOLVAX change that adds out_of_core and the python-mumps wheels; ImportError otherwise). End to end through solve(method="direct", direct_backend="mumps") on the HSX QHS full-FP deck, 66,004 unknowns, 8 pinned cores of the shared office host (load 18 to 26): 84 s in core and 75 s out of core, including the 3,008-product assembly, relative residual 6e-14 and 8e-14 (SuperLU: 47 min). MUMPS analysis of the 633,604-unknown gap deck, 51 s: 94 GB in core (PORD ordering 86 GB), or 13 GB of memory and about 77 GB of disk out of core, 1.5e14 flops. Block low-rank compression gave no memory gain at 66,004 unknowns and is not exposed.
  • [resolution] angles = "spectral" selects Fourier collocation for the theta and zeta derivatives of a native case (default finite_difference, the fourth-order stencils, unchanged; the default is omitted from the canonical case so existing case IDs hold). On analytic W7-X at 1e20 m^-3, 1 keV, pitch 64, speed 8, the particle and heat flux error against the 21 x 49 spectral value falls from 3.7% to 0.3% at 13 x 17 points with spectral angles, where fourth-order differences still leave 2.1%; on the LHD 1/nu case at the same density, finite differences are still 1.5% off at 21 x 49 and spectral angles are below 1% from 13 x 17 (laptop, 4 threads). Warm solve time is the same at equal grid (analytic W7-X 15 x 25 x 48 x 6: 1.0 s finite differences, 0.9 s spectral).
  • dkx run --check-grid [AXIS ...], dkx scan --check-grid and run_case(check_grid=...) attach a per-radius resolution certificate with one extra solve: all of theta, zeta, pitch and speed (or the named ones) are refined together by 1.25 and each surface is resolved when its particle and heat fluxes move by less than 2% and, for an ambipolar profile, its root by less than 0.05 kV/m. The result carries resolution_change, resolution_resolved (and resolution_root_change_kV_m), metadata["resolution_certificate"] and a warning naming the unresolved radii; a scan gains a resolution_change column. dkx.workflows.converge.certify_resolution is the Python entry.
  • Tutorial 5 and 13_convergence.py use a deck that converges: the old one (n = 8e19 m^-3, T = 1 keV, tokamak with zeta = 1) moved the particle flux by 8-17% per theta rung up to 41 points. The new one (n = 2e20 m^-3, T = 0.2 keV) is within 2% of its finest rung from 13/12/5 on, and dkx converge at theta 21, pitch 20, speed 6 reports 0.8%, converged. The page quotes the real output.
  • W7-X ambipolar profile re-measured with spectral angles (validation matrix): roots moved by up to 3.3 kV/m from the scaffold, and the electron-root flux still moves 2.7% for $N_\zeta$ 55 to 67 at $N_\xi$ 192, so the profile is not promoted.
  • Docs: docs/user_guide/convergence.md gains the per-radius certificate and a measured table of the grid to choose by collisionality (W7-X, LHD, tokamak) and by angle scheme.
  • Validation: cross_code_gaps gains W7-X Phi1 in the kinetic equation at E_r = -2 with a C6+ impurity against SFINCS (four resolutions, fluxes within 1.2e-7, flows within 1.8e-5 scaled; DKX peaks at 5 to 11 GB where SFINCS needs about 1 GB, and 13x45x48x5 exceeds 14 GB), and a converged monoenergetic ladder on W7-X EIM. DKX, YANCC and MONKES each converge, but D11* is 0.2656, 0.2947 and 0.3024 (DSHAPE agrees to 0.09%), so the 6% gate is not tightened. The sealed 5.5% came from finite-difference angles. The improved Sugama model is pinned against Spitzer-Harm (22.6% to 5.4% low for Z = 1 to 16). RHSMode 4/5: SFINCS's adjoint output differs from its own finite-difference check by up to 66% on W7-X, so there is no Fortran oracle.
  • The bootstrap current against Redl is a resolution and field effect, not a convention error. Tutorial 12's 0.64 (FP over Redl) is the default grid; on that non-quasi-symmetric seed it falls to 0.57 at 29x29 angles (Nxi=48, Nx=6, 0.57 to 0.58 across 21 to 37 angles). DKX and SFINCS (v3, 1 rank, MUMPS) agree on the same decks to 1e-4 to 4e-4 (QA beta 2.5%, s=0.5, four grids) and 2e-4 (seed, 17x17x64x7). Where Redl is exact, a large-aspect-ratio tokamak, FP is 1.015 and 1.018 of it at n = 1e19 and 1e20 m^-3 (41 angles, Nx=7, Nxi=48), pitch-angle scattering 1.15; new tests/test_bootstrap_redl_tokamak.py pins this at 3% (43 s cold). Precise-QA beta 2.5%, s=0.5, FP over Redl: 0.98 at 25x37x64x7, 0.89 at 25x37x32x5, but 0.82 and 1.32 at the angular grids 19x29 and 21x31 (both codes), so check angles as well as Nxi and Nx. Office host, 8 pinned cores, load 18 to 30, JAX 0.12.0. Docs: tutorial page 8; tutorial 12 comment.
  • The bootstrap current against Redl is a resolution and field effect, not a convention error. Tutorial 12's 0.64 (FP over Redl) is the default grid; on that non-quasi-symmetric seed it falls to 0.57 at 29x29 angles (Nxi=48, Nx=6, 0.57 to 0.58 across 21 to 37 angles). DKX and SFINCS (v3, 1 rank, MUMPS) agree on the same decks to 1e-4 to 5e-4 (QA beta 2.5%, s=0.5, four grids) and 2e-4 (seed, 17x17x64x7). Where Redl is exact, a large-aspect-ratio tokamak, FP is 1.015 and 1.018 of it at n = 1e19 and 1e20 m^-3 (41 angles, Nx=7, Nxi=48), pitch-angle scattering 1.15; new tests/test_bootstrap_redl_tokamak.py pins this at 3% (43 s cold). Precise-QA beta 2.5%, s=0.5, FP over Redl: 0.98 at 25x37x64x7, 0.89 at 25x37x32x5, but 0.82 and 1.32 at the angular grids 19x29 and 21x31 (both codes), so check angles as well as Nxi and Nx. Office host, 8 pinned cores, load 18 to 30, JAX 0.12.0. Docs: tutorial page 8; tutorial 12 comment.
  • Bootstrap current against Redl in the precise quasi-helical field of Landreman and Paul (nfp 4, reactor scale, Zeff = 1, Te = Ti, helicity N = -4), s = 0.25, 0.5, 0.75, full Fokker-Planck at 31x31 angles, Nxi=64, Nx=6: 1.050, 1.069, 1.012 of Redl, within 1e-3 of SFINCS v3 (1 rank, MUMPS) on the same decks. At s = 0.5 the ratio is 1.131, 1.069, 1.037 for 25, 31, 37 angles (s = 0.75: 1.012, 1.003), so angles still move it by 3%. Nxi=32 gives 0.94 and is under-resolved (SFINCS agrees). New tests/test_bootstrap_redl_qh.py (86 s, 4 cores, marked slow) pins DKX to SFINCS at 1% and to 1.12 of Redl at 25x25, Nxi=48, Nx=5; the wout is the simsopt test file (MIT, 0.8 MB as xz). Office host, JAX 0.12.0, 4 to 8 pinned cores, load 18 to 25.