Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/common/m_mpi_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ contains
proc_rank = 0
#endif

! First device operation, on the default device: with NVHPC OpenMP offload a rank's first one must come before
! omp_set_default_device moves it to another GPU, or its later allocations fail with CUDA_ERROR_INVALID_CONTEXT. The
! bound device gets its own copy in s_initialize_mpi_domain.
$: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.
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ contains
#endif
#endif

! After the device is bound: s_mpi_initialize ran earlier, so its update went to the default device
! After the device is bound: the update in s_mpi_initialize went to the default device
$:GPU_UPDATE(device='[num_procs, proc_rank]')

if (proc_rank == 0) then
Expand Down
Loading