diff --git a/assimilation_code/modules/utilities/mpi_utilities_mod.f90 b/assimilation_code/modules/utilities/mpi_utilities_mod.f90 index 90797018e8..d9bd640a38 100644 --- a/assimilation_code/modules/utilities/mpi_utilities_mod.f90 +++ b/assimilation_code/modules/utilities/mpi_utilities_mod.f90 @@ -12,11 +12,6 @@ !> and allows programs to swap in the null version to compile the !> same source files into a serial program. !> -!> The names of these routines were intentionally picked to be -!> more descriptive to someone who doesn't the MPI interfaces. -!> e.g. MPI_AllReduce() may not immediately tell a user what -!> it does, but broadcast_minmax() is hopefully more helpful. -!> !> If you add any routines or change any arguments in this file !> you must make the same changes in the null version. These two !> modules have the same module name and must have identical @@ -138,9 +133,8 @@ module mpi_utilities_mod task_sync, array_broadcast, send_to, receive_from, iam_task0, & broadcast_send, broadcast_recv, shell_execute, sleep_seconds, & sum_across_tasks, get_dart_mpi_comm, datasize, send_minmax_to, & - get_from_fwd, get_from_mean, broadcast_minmax, broadcast_flag, & - start_mpi_timer, read_mpi_timer, send_sum_to, get_global_max, & - all_reduce_min_max ! deprecated, replace by broadcast_minmax + get_from_fwd, get_from_mean, broadcast_flag, start_mpi_timer, & + read_mpi_timer, send_sum_to, get_global_max, all_reduce_min_max character(len=*), parameter :: source = 'mpi_utilities_mod.f90' @@ -1467,26 +1461,11 @@ end subroutine send_minmax_to !----------------------------------------------------------------------------- -!> cover routine which is deprecated. when all user code replaces this -!> with broadcast_minmax(), remove this. - -subroutine all_reduce_min_max(min_var, max_var, num_elements) - -integer, intent(in) :: num_elements -real(r8), intent(inout) :: min_var(num_elements) -real(r8), intent(inout) :: max_var(num_elements) - -call broadcast_minmax(min_var, max_var, num_elements) - -end subroutine all_reduce_min_max - -!----------------------------------------------------------------------------- - !> Find min and max of each element of an array, put the result on every task. !> Overwrites arrays min_var, max_var with the minimum and maximum for each !> element across all tasks. -subroutine broadcast_minmax(min_var, max_var, num_elements) +subroutine all_reduce_min_max(min_var, max_var, num_elements) integer, intent(in) :: num_elements real(r8), intent(inout) :: min_var(num_elements) @@ -1502,7 +1481,7 @@ subroutine broadcast_minmax(min_var, max_var, num_elements) call mpi_allreduce(MPI_IN_PLACE, min_var, num_elements, datasize, MPI_MIN, get_dart_mpi_comm(), errcode) call mpi_allreduce(MPI_IN_PLACE, max_var, num_elements, datasize, MPI_MAX, get_dart_mpi_comm(), errcode) -end subroutine broadcast_minmax +end subroutine all_reduce_min_max !----------------------------------------------------------------------------- !> Broadcast logical diff --git a/assimilation_code/modules/utilities/mpif08_utilities_mod.f90 b/assimilation_code/modules/utilities/mpif08_utilities_mod.f90 index dee8c618d1..51bc507fe0 100644 --- a/assimilation_code/modules/utilities/mpif08_utilities_mod.f90 +++ b/assimilation_code/modules/utilities/mpif08_utilities_mod.f90 @@ -12,11 +12,6 @@ !> and allows programs to swap in the null version to compile the !> same source files into a serial program. !> -!> The names of these routines were intentionally picked to be -!> more descriptive to someone who doesn't the MPI interfaces. -!> e.g. MPI_AllReduce() may not immediately tell a user what -!> it does, but broadcast_minmax() is hopefully more helpful. -!> !> If you add any routines or change any arguments in this file !> you must make the same changes in the null version. These two !> modules have the same module name and must have identical @@ -138,9 +133,8 @@ module mpi_utilities_mod task_sync, array_broadcast, send_to, receive_from, iam_task0, & broadcast_send, broadcast_recv, shell_execute, sleep_seconds, & sum_across_tasks, get_dart_mpi_comm, datasize, send_minmax_to, & - get_from_fwd, get_from_mean, broadcast_minmax, broadcast_flag, & - start_mpi_timer, read_mpi_timer, send_sum_to, get_global_max, & - all_reduce_min_max ! deprecated, replace by broadcast_minmax + get_from_fwd, get_from_mean, broadcast_flag, start_mpi_timer, & + read_mpi_timer, send_sum_to, get_global_max, all_reduce_min_max character(len=*), parameter :: source = 'mpi_utilities_mod.f90' @@ -1467,26 +1461,11 @@ end subroutine send_minmax_to !----------------------------------------------------------------------------- -!> cover routine which is deprecated. when all user code replaces this -!> with broadcast_minmax(), remove this. - -subroutine all_reduce_min_max(min_var, max_var, num_elements) - -integer, intent(in) :: num_elements -real(r8), intent(inout) :: min_var(num_elements) -real(r8), intent(inout) :: max_var(num_elements) - -call broadcast_minmax(min_var, max_var, num_elements) - -end subroutine all_reduce_min_max - -!----------------------------------------------------------------------------- - !> Find min and max of each element of an array, put the result on every task. !> Overwrites arrays min_var, max_var with the minimum and maximum for each !> element across all tasks. -subroutine broadcast_minmax(min_var, max_var, num_elements) +subroutine all_reduce_min_max(min_var, max_var, num_elements) integer, intent(in) :: num_elements real(r8), intent(inout) :: min_var(num_elements) @@ -1502,7 +1481,7 @@ subroutine broadcast_minmax(min_var, max_var, num_elements) call mpi_allreduce(MPI_IN_PLACE, min_var, num_elements, datasize, MPI_MIN, get_dart_mpi_comm(), errcode) call mpi_allreduce(MPI_IN_PLACE, max_var, num_elements, datasize, MPI_MAX, get_dart_mpi_comm(), errcode) -end subroutine broadcast_minmax +end subroutine all_reduce_min_max !----------------------------------------------------------------------------- !> Broadcast logical diff --git a/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 b/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 index cc729c23aa..f2d38eb057 100644 --- a/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 +++ b/assimilation_code/modules/utilities/null_mpi_utilities_mod.f90 @@ -109,9 +109,8 @@ module mpi_utilities_mod task_sync, array_broadcast, send_to, receive_from, iam_task0, & broadcast_send, broadcast_recv, shell_execute, sleep_seconds, & sum_across_tasks, get_dart_mpi_comm, datasize, send_minmax_to, & - get_from_fwd, get_from_mean, broadcast_minmax, broadcast_flag, & - start_mpi_timer, read_mpi_timer, send_sum_to, get_global_max, & - all_reduce_min_max ! deprecated, replace by broadcast_minmax + get_from_fwd, get_from_mean, broadcast_flag, start_mpi_timer, & + read_mpi_timer, send_sum_to, get_global_max, all_reduce_min_max character(len=*), parameter :: source = 'null_mpi_utilities_mod.f90' @@ -432,32 +431,17 @@ end subroutine send_minmax_to !----------------------------------------------------------------------------- -!> cover routine which is deprecated. when all user code replaces this -!> with broadcast_minmax(), remove this. - -subroutine all_reduce_min_max(min_var, max_var, num_elements) - -integer, intent(in) :: num_elements -real(r8), intent(inout) :: min_var(num_elements) -real(r8), intent(inout) :: max_var(num_elements) - -call broadcast_minmax(min_var, max_var, num_elements) - -end subroutine all_reduce_min_max - -!----------------------------------------------------------------------------- - !> Find min and max of each element of an array across tasks, put the result on every task. !> For this null_mpi_version min_var and max_var are unchanged because there is !> only 1 task. -subroutine broadcast_minmax(min_var, max_var, num_elements) +subroutine all_reduce_min_max(min_var, max_var, num_elements) integer, intent(in) :: num_elements real(r8), intent(inout) :: min_var(num_elements) real(r8), intent(inout) :: max_var(num_elements) -end subroutine broadcast_minmax +end subroutine all_reduce_min_max !----------------------------------------------------------------------------- diff --git a/models/FESOM/model_mod.f90 b/models/FESOM/model_mod.f90 index 3233cf1492..b6387431f6 100644 --- a/models/FESOM/model_mod.f90 +++ b/models/FESOM/model_mod.f90 @@ -60,7 +60,7 @@ module model_mod use obs_kind_mod, only : get_index_for_quantity -use mpi_utilities_mod, only: my_task_id, broadcast_minmax, task_count +use mpi_utilities_mod, only: my_task_id, all_reduce_min_max, task_count use fesom_modules, only: read_node, read_aux3, read_depth, read_namelist, & nCells => myDim_nod2D, & ! number of surface locations @@ -828,7 +828,7 @@ subroutine pert_model_copies(ens_handle, ens_size, pert_amp, interf_provided) enddo ! get global min/max for each variable -call broadcast_minmax(min_var, max_var, num_variables) +call all_reduce_min_max(min_var, max_var, num_variables) deallocate(within_range) call init_random_seq(random_seq, my_task_id()+1) diff --git a/models/mpas_atm/model_mod.f90 b/models/mpas_atm/model_mod.f90 index 29282f7a8a..839921d457 100644 --- a/models/mpas_atm/model_mod.f90 +++ b/models/mpas_atm/model_mod.f90 @@ -104,7 +104,7 @@ module model_mod QTY_SURFACE_TYPE, & ! for rttov QTY_CLOUD_FRACTION ! for rttov -use mpi_utilities_mod, only: my_task_id, broadcast_minmax +use mpi_utilities_mod, only: my_task_id, all_reduce_min_max use random_seq_mod, only: random_seq_type, init_random_seq, random_gaussian @@ -1812,7 +1812,7 @@ subroutine pert_model_copies(ens_handle, ens_size, pert_amp, interf_provided) enddo ! get global min/max for each variable -call broadcast_minmax(min_var, max_var, num_variables) +call all_reduce_min_max(min_var, max_var, num_variables) deallocate(within_range) call init_random_seq(random_seq, my_task_id()+1)