flow_global_max_owned Function

public function flow_global_max_owned(flow, a) result(global_max)

Uses

  • proc~~flow_global_max_owned~~UsesGraph proc~flow_global_max_owned mod_mpi_flow::flow_global_max_owned module~mod_profiler mod_profiler proc~flow_global_max_owned->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

Computes the global maximum magnitude of a field over owned cells.

Arguments

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

Return Value real(kind=rk)


Calls

proc~~flow_global_max_owned~~CallsGraph proc~flow_global_max_owned mod_mpi_flow::flow_global_max_owned mpi_allreduce mpi_allreduce proc~flow_global_max_owned->mpi_allreduce proc~check_mpi~2 mod_mpi_flow::check_mpi proc~flow_global_max_owned->proc~check_mpi~2 proc~profiler_start mod_profiler::profiler_start proc~flow_global_max_owned->proc~profiler_start proc~profiler_stop mod_profiler::profiler_stop proc~flow_global_max_owned->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

Called by

proc~~flow_global_max_owned~~CalledByGraph proc~flow_global_max_owned mod_mpi_flow::flow_global_max_owned proc~compute_flow_diagnostics mod_flow_projection::compute_flow_diagnostics proc~compute_flow_diagnostics->proc~flow_global_max_owned proc~advance_projection_step mod_flow_projection::advance_projection_step proc~advance_projection_step->proc~compute_flow_diagnostics program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~compute_flow_diagnostics program~lowmach_react_hex->proc~advance_projection_step

Source Code

   function flow_global_max_owned(flow, a) result(global_max)
      use mod_profiler, only : profiler_start, profiler_stop
      type(flow_mpi_t), intent(in) :: flow
      real(rk), intent(in) :: a(:)
      real(rk) :: global_max, local_max
      integer :: c, ierr

      local_max = 0.0_rk
      do c = flow%first_cell, flow%last_cell
         local_max = max(local_max, abs(a(c)))
      end do

      if (flow%nprocs == 1) then
         global_max = local_max
         return
      end if

      call profiler_start('MPI_Communication')
      call MPI_Allreduce(local_max, global_max, 1, MPI_DOUBLE_PRECISION, MPI_MAX, flow%comm, ierr)
      call check_mpi(ierr, 'MPI_Allreduce flow max')
      call profiler_stop('MPI_Communication')
   end function flow_global_max_owned