Skip to content

Commit 141ff01

Browse files
sbryngelsonSpencer Bryngelson
andauthored
fix: extend CCE 19.0.0 -Oipa0 workaround to m_mpi_common.fpp (#1409)
Co-authored-by: Spencer Bryngelson <sbryngelson@login10.frontier.olcf.ornl.gov>
1 parent b3fcc2a commit 141ff01

3 files changed

Lines changed: 41 additions & 14 deletions

File tree

.github/workflows/common/build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,23 @@ fi
2525
# source code is built here on the compute node.
2626
# Phoenix: always start fresh to avoid SIGILL from stale binaries compiled
2727
# on a different microarchitecture.
28+
# Frontier: wipe only compiled Fortran staging/install slugs; preserve dep
29+
# dirs (silo, hdf5, lapack, fftw, hipfort) which were built on the login node
30+
# and cannot be re-fetched from a compute node (no internet).
2831
if [ "$job_cluster" = "phoenix" ]; then
2932
source .github/scripts/clean-build.sh
3033
clean_build
34+
elif [ "$job_cluster" = "frontier" ] || [ "$job_cluster" = "frontier_amd" ]; then
35+
for _dir in build/staging/ build/install/; do
36+
if [ -d "$_dir" ]; then
37+
for _sub in "$_dir"*/; do
38+
_name=$(basename "$_sub")
39+
case "$_name" in silo|hdf5|lapack|fftw|hipfort) continue ;; esac
40+
rm -rf "$_sub"
41+
done
42+
fi
43+
done
44+
unset _dir _sub _name
3145
fi
3246

3347
source .github/scripts/retry-build.sh

CMakeLists.txt

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -734,26 +734,39 @@ if (MFC_PRE_PROCESS)
734734
MPI)
735735
if(CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
736736
target_compile_options(pre_process PRIVATE -hfp0)
737+
# CCE 19.0.0 IPA ICE: bring_routine_resident SIGSEGV in optcg during
738+
# ipa_processing. Nondeterministic — any file can become the crash site
739+
# via cross-file inlining. Safe to disable IPA for the whole target
740+
# (CPU-only, no GPU device-call requirements). See PR #1286.
741+
target_compile_options(pre_process PRIVATE -Oipa0)
737742
endif()
738743
endif()
739744

740745
if (MFC_SIMULATION)
741746
MFC_SETUP_TARGET(TARGET simulation
742747
SOURCES "${simulation_SRCs}"
743748
MPI FFTW OpenACC OpenMP)
744-
# CCE 19.0.0 IPA workaround: disable interprocedural analysis for files
745-
# that trigger compiler crashes during IPA:
746-
# m_bubbles_EL: castIsValid assertion (InstCombine/foldIntegerTypedPHI)
747-
# m_phase_change: bring_routine_resident SIGSEGV
748-
# Not applied to Cray+OpenMP because thermochem uses !DIR$ INLINEALWAYS,
749-
# which requires IPA to inline device calls. On OpenACC the pyrometheus
750-
# patch emits !$acc routine seq instead (no IPA needed). See PR #1286.
751-
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray" AND NOT MFC_OpenMP)
752-
set_source_files_properties(
753-
"${CMAKE_BINARY_DIR}/fypp/simulation/m_bubbles_EL.fpp.f90"
754-
"${CMAKE_BINARY_DIR}/fypp/simulation/m_phase_change.fpp.f90"
755-
PROPERTIES COMPILE_OPTIONS "-Oipa0"
756-
)
749+
# CCE 19.0.0 optcg ICE: IPA inlining triggers two distinct crashes:
750+
# m_bubbles_EL: castIsValid assertion (InstCombine/foldIntegerTypedPHI)
751+
# m_phase_change, m_mpi_common, m_start_up: bring_routine_resident SIGSEGV
752+
# GPU builds: apply -Oipa0 per-file to known crash sites. Whole-target
753+
# -Oipa0 is not safe for GPU builds — it breaks cross-file !$acc routine /
754+
# !DIR$ INLINEALWAYS device-call registration, causing runtime aborts.
755+
# CPU builds: disable IPA for the whole target (safe — no GPU requirements,
756+
# and the crash is nondeterministic so any file can become the crash site).
757+
# See PR #1286.
758+
if (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
759+
if (MFC_OpenACC OR MFC_OpenMP)
760+
set_source_files_properties(
761+
"${CMAKE_BINARY_DIR}/fypp/simulation/m_bubbles_EL.fpp.f90"
762+
"${CMAKE_BINARY_DIR}/fypp/simulation/m_phase_change.fpp.f90"
763+
"${CMAKE_BINARY_DIR}/fypp/simulation/m_mpi_common.fpp.f90"
764+
"${CMAKE_BINARY_DIR}/fypp/simulation/m_start_up.fpp.f90"
765+
PROPERTIES COMPILE_OPTIONS "-Oipa0"
766+
)
767+
else()
768+
target_compile_options(simulation PRIVATE -Oipa0)
769+
endif()
757770
endif()
758771
endif()
759772

toolchain/bootstrap/modules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ if [ "$u_c" '==' 'famd' ]; then
145145
export CRAY_MPICH_LIB="-L${CRAY_MPICH_PREFIX}/lib \
146146
${CRAY_PMI_POST_LINK_OPTS} \
147147
-lmpifort_amd -lmpi_amd -lmpi -lpmi -lpmi2"
148-
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CRAY_LD_LIBRARY_PATH}"
148+
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CRAY_LD_LIBRARY_PATH}"
149149
export CMAKE_PREFIX_PATH="${OLCF_AFAR_ROOT}:${CMAKE_PREFIX_PATH}"
150150
export FC="${OLCF_AFAR_ROOT}/bin/amdflang"
151151

0 commit comments

Comments
 (0)