Skip to content

Commit 8b9bb34

Browse files
author
Spencer Bryngelson
committed
fix: resolve Frontier CCE 3D cylindrical test failures
Two root causes for 5 failing 3D Cylindrical tests on Frontier CCE: 1. Post-process segfault (non-viscous tests 301B9153, 128954AD): s_axis() declared pb_in/mv_in as non-optional, but they are passed as absent optionals from s_populate_variables_buffers in post_process. CCE dereferences the null descriptor; gfortran tolerates it. Added 'optional' attribute and present() guards, matching peer routines like s_symmetry and s_periodic. 2. Simulation FPE (viscous tests 07C33719, 939D6718, 09623DE3): The direct MPI execution path in the test runner bypasses the batch template which sets 'ulimit -s unlimited'. CCE-compiled viscous cylindrical binaries overflow the default stack. Set the soft stack limit to the hard limit at module load via resource.setrlimit.
1 parent 31e47ee commit 8b9bb34

3 files changed

Lines changed: 11 additions & 135 deletions

File tree

FRONTIER_CCE_POST_PROCESS.md

Lines changed: 0 additions & 133 deletions
This file was deleted.

src/common/m_boundary_common.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ contains
763763
subroutine s_axis(q_prim_vf, pb_in, mv_in, k, l)
764764
$:GPU_ROUTINE(parallelism='[seq]')
765765
type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
766-
real(stp), dimension(idwbuff(1)%beg:, idwbuff(2)%beg:, idwbuff(3)%beg:, 1:, 1:), intent(inout) :: pb_in, mv_in
766+
real(stp), optional, dimension(idwbuff(1)%beg:, idwbuff(2)%beg:, idwbuff(3)%beg:, 1:, 1:), intent(inout) :: pb_in, mv_in
767767
integer, intent(in) :: k, l
768768

769769
integer :: j, q, i
@@ -804,7 +804,7 @@ contains
804804
end if
805805
end do
806806

807-
if (qbmm .and. .not. polytropic) then
807+
if (qbmm .and. .not. polytropic .and. present(pb_in) .and. present(mv_in)) then
808808
do i = 1, nb
809809
do q = 1, nnode
810810
do j = 1, buff_size

toolchain/mfc/test/case.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import itertools
77
import json
88
import os
9+
import resource
910
import shutil
1011
import subprocess
1112
from typing import Callable, Dict, List, Optional, Set, Union
@@ -15,6 +16,14 @@
1516
from ..run import input
1617
from ..state import ARG
1718

19+
# MFC simulations (especially viscous cylindrical cases) require large stack
20+
# sizes. The batch templates all include `ulimit -s unlimited`, but the direct
21+
# MPI execution path in the test runner bypasses the templates. Set the soft
22+
# stack limit to the hard limit so that spawned MPI processes inherit it.
23+
_soft, _hard = resource.getrlimit(resource.RLIMIT_STACK)
24+
if _soft != resource.RLIM_INFINITY and _soft < _hard:
25+
resource.setrlimit(resource.RLIMIT_STACK, (_hard, _hard))
26+
1827

1928
@dataclasses.dataclass
2029
class MPIConfig:

0 commit comments

Comments
 (0)