flow_allreduce_global_scalar Subroutine

public subroutine flow_allreduce_global_scalar(flow, local_values, global_values)

Uses

  • proc~~flow_allreduce_global_scalar~~UsesGraph proc~flow_allreduce_global_scalar mod_mpi_flow::flow_allreduce_global_scalar module~mod_profiler mod_profiler proc~flow_allreduce_global_scalar->module~mod_profiler iso_fortran_env iso_fortran_env module~mod_profiler->iso_fortran_env module~mod_kinds mod_kinds module~mod_profiler->module~mod_kinds mpi_f08 mpi_f08 module~mod_profiler->mpi_f08 module~mod_kinds->iso_fortran_env

Sum-Allreduce for a global scalar field.

Arguments

Type IntentOptional Attributes Name
type(flow_mpi_t), intent(in) :: flow
real(kind=rk), intent(in) :: local_values(:)
real(kind=rk), intent(out) :: global_values(:)

Calls

proc~~flow_allreduce_global_scalar~~CallsGraph proc~flow_allreduce_global_scalar mod_mpi_flow::flow_allreduce_global_scalar mpi_allreduce mpi_allreduce proc~flow_allreduce_global_scalar->mpi_allreduce proc~check_mpi~2 mod_mpi_flow::check_mpi proc~flow_allreduce_global_scalar->proc~check_mpi~2 proc~profiler_start mod_profiler::profiler_start proc~flow_allreduce_global_scalar->proc~profiler_start proc~profiler_stop mod_profiler::profiler_stop proc~flow_allreduce_global_scalar->proc~profiler_stop proc~fatal_error mod_kinds::fatal_error proc~check_mpi~2->proc~fatal_error mpi_wtime mpi_wtime proc~profiler_start->mpi_wtime proc~find_or_create_timer mod_profiler::find_or_create_timer proc~profiler_start->proc~find_or_create_timer proc~profiler_stop->mpi_wtime proc~profiler_stop->proc~find_or_create_timer proc~record_edge mod_profiler::record_edge proc~profiler_stop->proc~record_edge

Source Code

   subroutine flow_allreduce_global_scalar(flow, local_values, global_values)
      use mod_profiler, only : profiler_start, profiler_stop
      type(flow_mpi_t), intent(in) :: flow
      real(rk), intent(in) :: local_values(:)
      real(rk), intent(out) :: global_values(:)
      integer :: ierr

      call profiler_start('MPI_Communication')
      call MPI_Allreduce(local_values, global_values, size(local_values), &
                         MPI_DOUBLE_PRECISION, MPI_SUM, flow%comm, ierr)
      call check_mpi(ierr, 'MPI_Allreduce flow scalar')
      call profiler_stop('MPI_Communication')
   end subroutine flow_allreduce_global_scalar