Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
4c53633
Make cray_inline/cray_noinline actually take effect on Cray GPU builds
sbryngelson Jul 27, 2026
72eb05b
Frontier: move to newest CCE/ROCm and stop hipfort drifting from the …
sbryngelson Jul 27, 2026
05b4db3
qbmm: hoist s_mom_inv's internal procedures to module scope
sbryngelson Jul 27, 2026
c9394ff
gpu macros: stop emitting defaultmap on CCE
sbryngelson Jul 28, 2026
d98f7a7
Frontier: add the CCE 21 device-link workarounds, quoted
sbryngelson Jul 28, 2026
7b52299
IBM: pass pb/mv unconditionally; drop the thread_limit AGPR workaround
sbryngelson Jul 28, 2026
75a518b
parallel_macros: convert the one #elif MFC_OpenMP missed in 4c536337
sbryngelson Jul 28, 2026
3184243
Frontier: work around the CCE 21 InstCombine PHI assert in case-optim…
sbryngelson Jul 29, 2026
1b95701
Frontier: use rocm/7.0.2, the OLCF-recommended pairing for cpe/26.03
sbryngelson Jul 29, 2026
c730997
Frontier: keep rocm/7.2.0 on the AMD slugs, 7.0.2 is CCE-only
sbryngelson Jul 29, 2026
623ac7c
Merge master into cce21-latest
sbryngelson Jul 29, 2026
05de169
Frontier/CCE21: drop -mai-insts via per-kernel vector_length, recover…
sbryngelson Jul 30, 2026
5d162c6
Revert "Frontier/CCE21: drop -mai-insts via per-kernel vector_length,…
sbryngelson Jul 30, 2026
07ed36f
Frontier/CCE21: recover the igr regression by dropping -mai-insts (CC…
sbryngelson Jul 30, 2026
72154f4
Merge branch 'master' into cce21-latest
sbryngelson Jul 31, 2026
209f9f3
Merge branch 'master' into cce21-latest
sbryngelson Aug 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/common/include/omp_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#:if MFC_COMPILER == NVIDIA_COMPILER_ID or MFC_COMPILER == PGI_COMPILER_ID
#:set default_val = 'defaultmap(tofrom:aggregate) defaultmap(tofrom:allocatable) defaultmap(tofrom:pointer) '
#:elif MFC_COMPILER == CCE_COMPILER_ID
#:set default_val = 'defaultmap(tofrom:aggregate) defaultmap(present:allocatable) defaultmap(present:pointer) '
#! CCE 21: ANY defaultmap clause makes an already-resident array read as
#! zero inside the target region, so a resident array silently appears
#! empty. Emit nothing, as is already done for AMD above.
#:set default_val = ''
#:elif MFC_COMPILER == AMD_COMPILER_ID
#:set default_val = ''
#:else
Expand Down Expand Up @@ -179,7 +182,9 @@
#:if MFC_COMPILER == NVIDIA_COMPILER_ID or MFC_COMPILER == PGI_COMPILER_ID
#:set omp_start_directive = '!$omp target teams loop defaultmap(firstprivate:scalar) bind(teams,parallel) '
#:elif MFC_COMPILER == CCE_COMPILER_ID
#:set omp_start_directive = '!$omp target teams distribute parallel do defaultmap(firstprivate:scalar) '
#! CCE 21: defaultmap(firstprivate:scalar) overrides an explicit map(to:) on a
#! scalar, so an atomic-updated counter reads back its initial value.
#:set omp_start_directive = '!$omp target teams distribute parallel do '
#:elif MFC_COMPILER == AMD_COMPILER_ID
#:set omp_start_directive = '!$omp target teams distribute parallel do '
#:else
Expand Down
34 changes: 20 additions & 14 deletions src/common/include/parallel_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,25 @@
#:if not isinstance(function_name, str)
#:stop "When using cray_noinline, function name must be given and given as a string"
#:endif
#:set cray_noinline_directive = ('!DIR$ NOINLINE ' + function_name).strip('\n')
#! INLINENEVER is the Cray spelling; !DIR$ NOINLINE draws ftn-790 "Unknown or
#! unsupported compiler directive" and is silently ignored.
#:set cray_noinline_directive = ('!DIR$ INLINENEVER ' + function_name).strip('\n')
#ifdef _CRAYFTN
#if MFC_OpenACC
#! !DIR$ INLINENEVER is independent of the offload directive: on a Cray GPU build the
#! routine needs BOTH its acc/omp device-registration directive and the inlining
#! control. Emitting only one of them silently dropped every cray_noinline request
#! on Cray GPU builds.
#if defined(MFC_OpenACC)
$:acc_directive
#elif MFC_OpenMP
#elif defined(MFC_OpenMP)
$:omp_directive
#else
$:cray_noinline_directive
#endif
$:cray_noinline_directive
#! On non-Cray CPU builds (no _CRAYFTN, no MFC_OpenACC, no MFC_OpenMP), nothing is
#! emitted — intentional, since !DIR$ NOINLINE is a Cray-specific directive.
#elif MFC_OpenACC
#! emitted — intentional, since !DIR$ INLINENEVER is a Cray-specific directive.
#elif defined(MFC_OpenACC)
$:acc_directive
#elif MFC_OpenMP
#elif defined(MFC_OpenMP)
$:omp_directive
#endif
#:elif cray_inline == True
Expand All @@ -89,16 +94,17 @@
#:endif
#:set cray_directive = ('!DIR$ INLINEALWAYS ' + function_name).strip('\n')
#ifdef _CRAYFTN
#if MFC_OpenACC
#! Same as cray_noinline above: the offload directive and !DIR$ INLINEALWAYS are
#! independent, and a Cray GPU build needs both.
#if defined(MFC_OpenACC)
$:acc_directive
#elif MFC_OpenMP
#elif defined(MFC_OpenMP)
$:omp_directive
#else
$:cray_directive
#endif
#elif MFC_OpenACC
$:cray_directive
#elif defined(MFC_OpenACC)
$:acc_directive
#elif MFC_OpenMP
#elif defined(MFC_OpenMP)
$:omp_directive
#endif
#:else
Expand Down
9 changes: 9 additions & 0 deletions src/common/include/shared_parallel_macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
#:set USING_CCE = (MFC_COMPILER == CCE_COMPILER_ID)
#:set USING_AMD = (MFC_COMPILER == AMD_COMPILER_ID)

#! Larger work-group for the handful of kernels that trip CCE 21's
#! "AMDGPU Rewrite AGPR-Copy-MFMA" assert during the device link. A bigger group means
#! fewer registers per thread, so the live-range split that produces the dead value
#! number never happens -- which lets -mattr=-mai-insts be dropped program-wide.
#! CCE ONLY: other compilers have no such assert and must not inherit a work-group
#! size tuned for gfx90a.
#:set CCE_AGPR_WG_ACC = 'vector_length(512)' if USING_CCE else None
#:set CCE_AGPR_WG_OMP = 'thread_limit(512)' if USING_CCE else None

#:def ASSERT_LIST(data, datatype)
#:assert data is not None
#:assert isinstance(data, list)
Expand Down
21 changes: 13 additions & 8 deletions src/common/m_variables_conversion.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ contains

! Chemistry
real(wp), dimension(1:num_species), intent(in) :: rhoYks
real(wp), dimension(1:num_species) :: Y_rs
real(wp) :: E_e
real(wp) :: e_Per_Kg, Pdyn_Per_Kg
real(wp) :: T_guess
integer :: s !< Generic loop iterator
!> Lower bound 0 is a deliberate, unused pad element: it keeps Y_rs(1) off private frame offset 0. Cray ftn builds a flat
!! pointer to a private object as zext(offset) with no aperture, so the flat->private cast back (select(p == null, ~0, trunc
!! p)) turns offset 0 into 0xFFFFFFFF and the scratch store lands 4 GiB out of bounds. Faults every chemistry case on CCE
!! 21/gfx90a. Do not tighten to 1:num_species without re-checking that the device image is free of `s_cselect_b32 sN, 0,
!! -1`.
real(wp), dimension(0:num_species) :: Y_rs
real(wp) :: E_e
real(wp) :: e_Per_Kg, Pdyn_Per_Kg
real(wp) :: T_guess
integer :: s !< Generic loop iterator
#:if not chemistry
! Depending on model_eqns and bubbles_euler, the appropriate procedure for computing pressure is targeted by the
! procedure pointer
Expand Down Expand Up @@ -122,14 +127,14 @@ contains
end if
#:else
! Reacting mixture pressure from temperature and species
Y_rs(:) = rhoYks(:)/rho
Y_rs(1:num_species) = rhoYks(:)/rho
e_Per_Kg = energy/rho
Pdyn_Per_Kg = dyn_p/rho

T_guess = T

call get_temperature(e_Per_Kg - Pdyn_Per_Kg, T_guess, Y_rs, .true., T)
call get_pressure(rho, T, Y_rs, pres)
call get_temperature(e_Per_Kg - Pdyn_Per_Kg, T_guess, Y_rs(1:num_species), .true., T)
call get_pressure(rho, T, Y_rs(1:num_species), pres)
#:endif

end subroutine s_compute_pressure
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_bubbles_EE.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ contains
adap_dt_stop_sum = 0
$:GPU_PARALLEL_LOOP(private='[j, k, l, Rtmp, Vtmp, myalpha_rho, myalpha, myR, myV, alf, myP, myRho, R2Vav, R3, nbub, &
& pb_local, mv_local, vflux, pbdot, rddot, n_tait, B_tait, adap_dt_stop, chi_vw_l, k_mw_l, &
& rho_mw_l]', collapse=3, copy='[adap_dt_stop_sum]')
& rho_mw_l]', collapse=3, copy='[adap_dt_stop_sum]', extraAccArgs=CCE_AGPR_WG_ACC, extraOmpArgs=CCE_AGPR_WG_OMP)
do l = 0, p
do k = 0, n
do j = 0, m
Expand Down
3 changes: 2 additions & 1 deletion src/simulation/m_bubbles_EL.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,8 @@ contains
$:GPU_PARALLEL_LOOP(private='[k, myalpha_rho, myalpha, Re, cell, myVapFlux, preterm1, term2, paux, pint, Romega, &
& term1_fac, myR_m, mygamma_m, myPb, myMass_n, myMass_v, myR, myV, myBeta_c, myBeta_t, myR0, myPbdot, &
& myMvdot, myPinf, aux1, aux2, myCson, myRho, gamma, pi_inf, qv, dmalf, dmntait, dmBtait, &
& dm_bub_adv_src, dm_divu, adap_dt_stop, myPos, myVel]', copy='[adap_dt_stop_sum]',copyin='[stage]')
& dm_bub_adv_src, dm_divu, adap_dt_stop, myPos, myVel]', copy='[adap_dt_stop_sum]',copyin='[stage]', &
& extraAccArgs=CCE_AGPR_WG_ACC, extraOmpArgs=CCE_AGPR_WG_OMP)
do k = 1, n_el_bubs_loc
! Keller-Miksis model

Expand Down
Loading
Loading