Skip to content

gpec SIGSEGV at end of multithreaded run (ifx build) without a raised stack #272

Description

@logan-nc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions