mpi_bcast_i32_array Subroutine

public subroutine mpi_bcast_i32_array(ctx, values, root)

root rankの32bit整数配列を全rankへbroadcastする。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
integer(kind=i32), intent(inout) :: values(:)
integer(kind=i32), intent(in) :: root

Called by

proc~~mpi_bcast_i32_array~~CalledByGraph proc~mpi_bcast_i32_array mpi_bcast_i32_array proc~maybe_write_periodic_checkpoint maybe_write_periodic_checkpoint proc~maybe_write_periodic_checkpoint->proc~mpi_bcast_i32_array proc~precompute_periodic_root_operator precompute_periodic_root_operator proc~precompute_periodic_root_operator->proc~mpi_bcast_i32_array proc~solve_matching_implicit_zero_mode solve_matching_implicit_zero_mode proc~solve_matching_implicit_zero_mode->proc~mpi_bcast_i32_array proc~core_build_panel_plan_impl core_build_panel_plan_impl proc~core_build_panel_plan_impl->proc~precompute_periodic_root_operator proc~core_build_plan_impl core_build_plan_impl proc~core_build_plan_impl->proc~precompute_periodic_root_operator

Source Code

  subroutine mpi_bcast_i32_array(ctx, values, root)
    type(mpi_context), intent(in) :: ctx
    integer(i32), intent(inout) :: values(:)
    integer(i32), intent(in) :: root
#ifdef USE_MPI
    integer, allocatable :: buffer(:)
    integer :: ierr
#endif

    if (root < 0_i32 .or. root >= max(1_i32, ctx%size)) then
      error stop 'mpi_bcast_i32_array root out of range.'
    end if
#ifdef USE_MPI
    if (.not. ctx%enabled) return
    allocate (buffer(size(values)))
    buffer = int(values, kind=kind(0))
    call MPI_Bcast(buffer, size(buffer), MPI_INTEGER, int(root), MPI_COMM_WORLD, ierr)
    values = int(buffer, kind=i32)
#endif
  end subroutine mpi_bcast_i32_array