From 978ef64fc1fdde745c444bba3bd454c42b31b3a9 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Mon, 1 Jun 2026 20:06:32 -0400 Subject: [PATCH] fix: unblock --debug/--reldebug GPU builds (guard host s_mpi_abort out of device code) s_compute_fast_magnetosonic_speed is a GPU routine (acc routine seq) but its MFC_DEBUG diagnostic block called host s_mpi_abort, which is illegal in device code without IPO inlining. Debug/reldebug builds disable IPO, so --gpu acc/mp debug builds failed with NVFORTRAN-S-1061. Guard the abort with #ifndef MFC_GPU, keeping the device-legal diagnostic print. CPU and Release builds are unchanged. --- src/common/m_variables_conversion.fpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/m_variables_conversion.fpp b/src/common/m_variables_conversion.fpp index 2417da1adf..19a3ce8728 100644 --- a/src/common/m_variables_conversion.fpp +++ b/src/common/m_variables_conversion.fpp @@ -1332,7 +1332,11 @@ contains #ifdef MFC_DEBUG if (disc < 0._wp) then print *, 'rho, c, Bx, By, Bz, h, term, disc:', rho, c, B(1), B(2), B(3), h, term, disc + ! s_mpi_abort is a host routine and cannot be called from device code + ! (this is a GPU routine); on GPU builds, emit the diagnostic print only. +#ifndef MFC_GPU call s_mpi_abort('Error: negative discriminant in s_compute_fast_magnetosonic_speed') +#endif end if #endif