Skip to content

Conversation

@bonachea
Copy link
Member

Fixes #87
Fixes #128

Example out-of-memory message:

ERROR STOP 'Fortran shared heap is out of memory
  while allocating 500 TiB of additional coarray memory.

  Shared heap size information:
    Total shared heap:               1 GiB    (CAF_HEAP_SIZE)
    Total non-coarray heap:        102 MiB    (CAF_COMP_FRAC * CAF_HEAP_SIZE)
    Current team coarray heap:     921 MiB

  Consider setting the CAF_HEAP_SIZE environment variable to request a larger heap.'

* Enforce segment size invariants

The symmetric and non-symmetric heaps must each be sized on page boundaries.

Previously some tiny or misaligned values of CAF_HEAP_SIZE would cause startup
time crashes inside caf_caffeinate or dlmalloc.

* Expose more shared heap information up into Fortran

* Convert heap size manipulation from size_t to (u)intptr_t
The use of list-directed output in `prif_(error_)stop(stop_code_char)`
was leading to processor-defined line break behavior, which is
quite poor in practice with flang.
@bonachea bonachea requested a review from ktras January 30, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add proper handling of shared memory exhaustion Ensure all PRIF calls with an optional stat argument actually set it when present

1 participant