Repository navigation
STRIDE - BUG FIX - Allocate threadprivate spline work arrays per thread instead of COPYIN in sing_asymp - #368
Open
SimonPinches wants to merge 1 commit into
Conversation
…ad instead of COPYIN in sing_asymp The parallel loop over singular surfaces in sing_asymp got its threadprivate spline work arrays (sq_s_f*, fmats_s_f*, locstab_s_f) via COPYIN. Their values are never needed (every spline evaluation overwrites them); COPYIN was only relied on, implicitly, to allocate them on threads of the nested team that did not take part in sing_parallel_alloc. With ifx (2025.2), COPYIN of allocated allocatable threadprivate arrays leaves the threads sharing storage, so the Mercier/asymptotic matrices race: di differs from run to run and STRIDE stops with "ZVODE1 integration failure" whenever nThreads > 1 (PrincetonUniversity#273). Add sing_thread_alloc, which allocates the calling thread's arrays if needed (the same pattern ode_run already uses), call it in sing_parallel_alloc and at the start of the sing_asymp parallel region, and COPYIN only the spline interval indices. Tested on the DIIID_ideal_example with nThreads=32, five runs each: ifx 2025.2 now terminates normally every time with identical energies; gfortran 14.3 results are bit-identical to before the change.
matt-pharr
self-requested a review
November 13, 2026 15:32
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #273.
The
sing_asympparallel region received its THREADPRIVATE spline work arrays (sq_s_f*,fmats_s_f*,locstab_s_f) throughCOPYIN. Their values are never used, since every spline evaluation overwrites them. TheCOPYINwas only relied on, implicitly, to allocate them on threads of the nestedvac_parallelteam that didn't runsing_parallel_alloc.With ifx,
COPYINof allocated allocatable THREADPRIVATE arrays leaves the threads sharing storage (reproducer in #273). The singular-surface matrices therefore race:dichanges from run to run, and STRIDE stops withZVODE1 integration failurewhenevernThreads > 1.Changes, all in
stride/sing.F:sing_thread_alloc: allocates each of the calling thread's work arrays if not yet allocated (same pattern asode_run);sing_parallel_alloccalls it, replacing itsALLOCATEs andCOPYIN;sing_asympregion calls it before the loop and copies in onlylocstab_s_ix, sq_s_ix, fmats_s_ix.Testing:
docs/examples/DIIID_ideal_example,nThreads=32, five runs per compiler: