From 63649fa3825a4bceaa502146a5ec73b4ff2d5b24 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 21 Nov 2026 07:29:51 -0800 Subject: [PATCH] GPU: send num_procs and proc_rank to the device after the rank is bound to its GPU --- src/common/m_mpi_common.fpp | 2 -- src/simulation/m_start_up.fpp | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/m_mpi_common.fpp b/src/common/m_mpi_common.fpp index 96469c55b1..7a549f6bb6 100644 --- a/src/common/m_mpi_common.fpp +++ b/src/common/m_mpi_common.fpp @@ -138,8 +138,6 @@ contains proc_rank = 0 #endif - $:GPU_UPDATE(device='[num_procs, proc_rank]') - end subroutine s_mpi_initialize !> Set up MPI I/O data views and variable pointers for parallel file output. diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index 8c5d89e91d..6e21a22684 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -1104,6 +1104,9 @@ contains #endif #endif + ! After the device is bound: s_mpi_initialize ran earlier, so its update went to the default device + $:GPU_UPDATE(device='[num_procs, proc_rank]') + if (proc_rank == 0) then call s_assign_default_values_to_user_inputs() call s_read_input_file()