oasis_weights: run the SCRIP weight-gen worker with an unlimited stack - #52
Merged
Conversation
The parallel SCRIP build (-qopenmp) makes ifort place large automatic arrays on the stack, and MCT's O(10^5) sparse-matrix sort in oasis_enddef overflows the default stack on large target grids -> SIGSEGV on the big weight links. Launch each per-link worker under `bash -c 'ulimit -s unlimited; exec ...'` and export a large OMP_STACKSIZE for the OpenMP threads. Verified: all 4 awiesm3 feom links then succeed and the whole weight-gen drops to ~28 s (was ~16 min serial) at 64 threads.
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.
Runtime companion to the OASIS OpenMP-SCRIP build fix (oasis3-mct MR enabling
-qopenmp).Problem. With the parallel SCRIP build,
-qopenmpmakes ifort place large automatic arrays on the stack. MCT's O(10⁵) sparse-matrix sort inoasis_enddefthen overflows the default stack on large-target links (e.g.A096→feom,RnfO→feomon a 208k-node ocean mesh) → SIGSEGV. The small-target link (→A096, 40k) survives, which is the diagnostic tell.Fix. In
generate_weights, launch each per-link worker underbash -c 'ulimit -s unlimited; exec <py> -m ocp_tool.oasis_weights <wdir>'(-c, not-lc, so the passed env dict is preserved) and export a largeOMP_STACKSIZEfor the OpenMP threads.Verified. With the OpenMP-rebuilt OASIS, all 4 awiesm3 feom links now succeed and the whole
generate_weightsdrops to ~28 s (was ~16 min serial) at 64 threads, on 2 nodes.