Found in review of the common-stage-independence refactor (b6bf034c, "Refactor variable conversion into common code").
In s_convert_conservative_to_primitive_variables the guard around the mixture-variable call changed from #ifdef MFC_SIMULATION to #ifdef MFC_GPU (src/common/m_variables_conversion.fpp:473).
MFC_GPU is defined only for --gpu acc / --gpu mp (cmake/MFCTargets.cmake:172,181), so a CPU-only simulation build now takes the #else host branch, which routes through s_convert_to_mixture_variables. That wrapper dispatches on model_eqns (m_variables_conversion.fpp:62):
model_eqns == 1 (gamma-law) -> s_convert_mixture_to_mixture_variables, reading gamma/pi_inf from the state vector
- GPU branch ->
s_convert_species_to_mixture_variables_kernel, computing gamma_K = alpha_K(1)*gammas(1)
These are different quantities. So ./mfc.sh build and ./mfc.sh build --gpu acc produce different primitives from the same restart for model_eqns == 1, and the CPU result also differs from master. For model_eqns 2/3 the two paths are equivalent, which is why this is invisible in normal use.
model_eqns = 1 is a supported simulation input (toolchain/mfc/case_validator.py:353), so this is reachable.
No test covers it: nothing in tests/ or examples/ sets model_eqns = 1.
Suggested fix: restore the MFC_SIMULATION semantics (or make the host branch call the same kernel), and add a model_eqns = 1 regression case so CPU/GPU divergence here is caught.
Found in review of the
common-stage-independencerefactor (b6bf034c, "Refactor variable conversion into common code").In
s_convert_conservative_to_primitive_variablesthe guard around the mixture-variable call changed from#ifdef MFC_SIMULATIONto#ifdef MFC_GPU(src/common/m_variables_conversion.fpp:473).MFC_GPUis defined only for--gpu acc/--gpu mp(cmake/MFCTargets.cmake:172,181), so a CPU-only simulation build now takes the#elsehost branch, which routes throughs_convert_to_mixture_variables. That wrapper dispatches onmodel_eqns(m_variables_conversion.fpp:62):model_eqns == 1(gamma-law) ->s_convert_mixture_to_mixture_variables, readinggamma/pi_inffrom the state vectors_convert_species_to_mixture_variables_kernel, computinggamma_K = alpha_K(1)*gammas(1)These are different quantities. So
./mfc.sh buildand./mfc.sh build --gpu accproduce different primitives from the same restart formodel_eqns == 1, and the CPU result also differs from master. Formodel_eqns2/3 the two paths are equivalent, which is why this is invisible in normal use.model_eqns = 1is a supported simulation input (toolchain/mfc/case_validator.py:353), so this is reachable.No test covers it: nothing in
tests/orexamples/setsmodel_eqns = 1.Suggested fix: restore the
MFC_SIMULATIONsemantics (or make the host branch call the same kernel), and add amodel_eqns = 1regression case so CPU/GPU divergence here is caught.