Summary
gpec SIGSEGVs at the end of a multithreaded run unless the stack is raised, on an
ifx/MKL build. The computation completes; the fault is in the final output/deallocation
phase.
Environment
- Compiler/libs: Intel oneAPI ifx/icx 2026.0 + MKL 2026.0, built with
make FFLAGS="-O3 -qopenmp" OMPFLAG="-qopenmp".
- Case: DIII-D-like reference equilibrium (hamada, ldp, mpsi=256, psihigh=0.995), COIL Biot–Savart forcing,
OMP_NUM_THREADS=8.
Symptom
The run reaches 100% ("Computing x and b normal components"), then:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
libc.so.6 ... Unknown Unknown Unknown
gpec ... Unknown Unknown Unknown
user time ~845 s vs real ~157 s (so ~8 OMP threads active). No SIGSEGV in the physics
loop; it faults during output/teardown.
Workaround (confirms cause)
Setting ulimit -s unlimited and KMP_STACKSIZE=1G (note: OMP_STACKSIZE is ignored
once KMP_STACKSIZE is set — a warning is printed) gives a clean run:
GPEC STOP => Normal termination.
This points at large automatic arrays / per-thread stack overflow.
Suggested fix
Either compile with -heap-arrays (or move the large local arrays in the output/reconstruction
path to allocatable/heap), or document the ulimit -s unlimited + KMP_STACKSIZE requirement
in the install/run docs so multithreaded runs don't silently segfault on default stacks.
Summary
gpecSIGSEGVs at the end of a multithreaded run unless the stack is raised, on anifx/MKL build. The computation completes; the fault is in the final output/deallocation
phase.
Environment
make FFLAGS="-O3 -qopenmp" OMPFLAG="-qopenmp".OMP_NUM_THREADS=8.Symptom
The run reaches 100% ("Computing x and b normal components"), then:
usertime ~845 s vsreal~157 s (so ~8 OMP threads active). No SIGSEGV in the physicsloop; it faults during output/teardown.
Workaround (confirms cause)
Setting
ulimit -s unlimitedandKMP_STACKSIZE=1G(note:OMP_STACKSIZEis ignoredonce
KMP_STACKSIZEis set — a warning is printed) gives a clean run:This points at large automatic arrays / per-thread stack overflow.
Suggested fix
Either compile with
-heap-arrays(or move the large local arrays in the output/reconstructionpath to
allocatable/heap), or document theulimit -s unlimited+KMP_STACKSIZErequirementin the install/run docs so multithreaded runs don't silently segfault on default stacks.