Generic amdflang builds cap chemistry at ten species. The bound is a literal dimension(10) repeated across 21 declarations in nine files, swapped in for dimension(num_species) by the USING_AMD fypp guard when case optimization is off, and it is stated as a constraint in m_checker_common.fpp:
@:PROHIBIT(chemistry .and. num_species > 10, "num_species > 10 for AMDFLang when Case optimization is off")
Two problems.
The check never runs. m_thermochem.f90 is generated per mechanism with concrete bounds, so an eleven-species mechanism gives a dimension(11) dummy against a dimension(10) actual and the build dies first:
error: Actual argument array has fewer elements (10) than dummy
repeated across m_chemistry.fpp, m_cbc.fpp, m_riemann_state.fpp, m_ibm.fpp and the three Riemann solvers. The reader gets a wall of argument-mismatch errors rather than the sentence explaining the limit. Hit while adding an eleven-species mechanism in #1821.
Raising the literal is not free. These are per-thread arrays in the hot kernels. m_riemann_solver_hllc.fpp:63 alone declares eleven of them:
real(wp), dimension(10) :: Ys_L, Ys_R, Xs_L, Xs_R, Gamma_iL, Gamma_iR, Cp_iL, Cp_iR, R_species, h_iL, h_iR
110 doubles per thread at the current bound, 220 at dimension(20). On gfx90a a kernel drops from three waves per SIMD to two at 170 registers, so a bound raised for one mechanism is paid by every generic-build chemistry case on that backend.
Worth deciding between:
- Raise the bound and measure what it costs the chemistry kernels.
- Keep it and make the limit legible: a fypp-time failure carrying the message above, so the constraint is stated rather than inferred from argument mismatches.
- Drop the guards once the amdgpu compiler bug they work around is fixed, which removes the class.
Case-optimized builds are unaffected: the guard is not MFC_CASE_OPTIMIZATION and USING_AMD, so those take dimension(num_species) and any species count works.
Generic amdflang builds cap chemistry at ten species. The bound is a literal
dimension(10)repeated across 21 declarations in nine files, swapped in fordimension(num_species)by theUSING_AMDfypp guard when case optimization is off, and it is stated as a constraint inm_checker_common.fpp:Two problems.
The check never runs.
m_thermochem.f90is generated per mechanism with concrete bounds, so an eleven-species mechanism gives adimension(11)dummy against adimension(10)actual and the build dies first:repeated across
m_chemistry.fpp,m_cbc.fpp,m_riemann_state.fpp,m_ibm.fppand the three Riemann solvers. The reader gets a wall of argument-mismatch errors rather than the sentence explaining the limit. Hit while adding an eleven-species mechanism in #1821.Raising the literal is not free. These are per-thread arrays in the hot kernels.
m_riemann_solver_hllc.fpp:63alone declares eleven of them:110 doubles per thread at the current bound, 220 at
dimension(20). On gfx90a a kernel drops from three waves per SIMD to two at 170 registers, so a bound raised for one mechanism is paid by every generic-build chemistry case on that backend.Worth deciding between:
Case-optimized builds are unaffected: the guard is
not MFC_CASE_OPTIMIZATION and USING_AMD, so those takedimension(num_species)and any species count works.