bem_mpi Module

MPIの初期化・集約を抽象化し、非MPIビルドでは単一ランク動作へフォールバックする。


Uses

  • module~~bem_mpi~~UsesGraph module~bem_mpi bem_mpi module~bem_kinds bem_kinds module~bem_mpi->module~bem_kinds iso_fortran_env iso_fortran_env module~bem_kinds->iso_fortran_env

Used by

  • module~~bem_mpi~~UsedByGraph module~bem_mpi bem_mpi module~bem_app_config_particle_runtime bem_app_config_particle_runtime module~bem_app_config_particle_runtime->module~bem_mpi module~bem_coulomb_fmm_periodic_root_ops bem_coulomb_fmm_periodic_root_ops module~bem_coulomb_fmm_periodic_root_ops->module~bem_mpi module~bem_matching_plane_coupling bem_matching_plane_coupling module~bem_matching_plane_coupling->module~bem_mpi module~bem_matching_plane_implicit bem_matching_plane_implicit module~bem_matching_plane_coupling->module~bem_matching_plane_implicit module~bem_matching_plane_response_provider bem_matching_plane_response_provider module~bem_matching_plane_coupling->module~bem_matching_plane_response_provider module~bem_app_config bem_app_config module~bem_matching_plane_coupling->module~bem_app_config module~bem_matching_plane_implicit->module~bem_mpi module~bem_matching_plane_implicit->module~bem_matching_plane_response_provider module~bem_matching_plane_response bem_matching_plane_response module~bem_matching_plane_response->module~bem_mpi module~bem_matching_plane_response_generator bem_matching_plane_response_generator module~bem_matching_plane_response_generator->module~bem_mpi module~bem_matching_plane_response_generator->module~bem_matching_plane_response module~bem_matching_plane_response_generator->module~bem_matching_plane_response_provider module~bem_matching_plane_response_mpi bem_matching_plane_response_mpi module~bem_matching_plane_response_mpi->module~bem_mpi module~bem_matching_plane_response_mpi->module~bem_matching_plane_response module~bem_matching_plane_response_provider->module~bem_mpi module~bem_matching_plane_response_provider->module~bem_matching_plane_response module~bem_matching_plane_response_provider_mpi bem_matching_plane_response_provider_mpi module~bem_matching_plane_response_provider_mpi->module~bem_mpi module~bem_matching_plane_response_provider_mpi->module~bem_matching_plane_response module~bem_matching_plane_response_provider_mpi->module~bem_matching_plane_response_provider module~bem_matching_plane_zhao_atlas bem_matching_plane_zhao_atlas module~bem_matching_plane_zhao_atlas->module~bem_mpi module~bem_matching_plane_zhao_atlas->module~bem_matching_plane_response module~bem_matching_plane_zhao_atlas->module~bem_matching_plane_response_provider module~bem_performance_profile bem_performance_profile module~bem_performance_profile->module~bem_mpi module~bem_periodic_checkpoint bem_periodic_checkpoint module~bem_periodic_checkpoint->module~bem_mpi module~bem_restart bem_restart module~bem_periodic_checkpoint->module~bem_restart module~bem_restart->module~bem_mpi module~bem_restart_injection bem_restart_injection module~bem_restart_injection->module~bem_mpi module~bem_restart_injection->module~bem_restart module~bem_simulator bem_simulator module~bem_simulator->module~bem_mpi module~bem_app_config_runtime bem_app_config_runtime module~bem_simulator->module~bem_app_config_runtime module~bem_simulator->module~bem_app_config module~bem_simulator_loop bem_simulator_loop module~bem_simulator_loop->module~bem_mpi module~bem_simulator_loop->module~bem_matching_plane_coupling module~bem_simulator_loop->module~bem_performance_profile module~bem_simulator_loop->module~bem_periodic_checkpoint module~bem_simulator_loop->module~bem_simulator module~bem_simulator_loop->module~bem_app_config_runtime program~main main program~main->module~bem_mpi program~main->module~bem_matching_plane_response_provider program~main->module~bem_performance_profile program~main->module~bem_periodic_checkpoint program~main->module~bem_restart program~main->module~bem_simulator program~main->module~bem_app_config module~bem_app_config_particle_runtime_batch bem_app_config_particle_runtime_batch module~bem_app_config_particle_runtime_batch->module~bem_app_config_particle_runtime module~bem_app_config_particle_runtime_sampling bem_app_config_particle_runtime_sampling module~bem_app_config_particle_runtime_sampling->module~bem_app_config_particle_runtime module~bem_app_config_runtime->module~bem_app_config_particle_runtime module~bem_coulomb_fmm_plan_ops bem_coulomb_fmm_plan_ops module~bem_coulomb_fmm_plan_ops->module~bem_coulomb_fmm_periodic_root_ops module~bem_matching_plane_response_io bem_matching_plane_response_io module~bem_matching_plane_response_io->module~bem_matching_plane_response module~bem_restart_contract bem_restart_contract module~bem_restart_contract->module~bem_restart module~bem_restart_records bem_restart_records module~bem_restart_records->module~bem_restart module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_io bem_simulator_io module~bem_simulator_io->module~bem_simulator module~bem_simulator_io->module~bem_app_config_runtime module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_simulator module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator program~zhao_atlas_main zhao_atlas_main program~zhao_atlas_main->module~bem_matching_plane_zhao_atlas program~zhao_atlas_main->module~bem_app_config program~zhao_response_main zhao_response_main program~zhao_response_main->module~bem_matching_plane_response_generator program~zhao_response_main->module~bem_app_config module~bem_app_config->module~bem_app_config_runtime module~bem_coulomb_fmm_core_build bem_coulomb_fmm_core_build module~bem_coulomb_fmm_core_build->module~bem_coulomb_fmm_plan_ops

Derived Types

type, public ::  mpi_context

Components

Type Visibility Attributes Name Initial
integer(kind=i32), public :: rank = 0_i32
integer(kind=i32), public :: size = 1_i32
logical, public :: enabled = .false.

Functions

public function mpi_is_root(ctx)

root rank (rank=0) かどうかを返す。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx

Return Value logical

public function mpi_world_size(ctx)

MPI world size を返す(size<=0 は 1 へ補正)。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in), optional :: ctx

Return Value integer(kind=i32)

public function mpi_split_count(total_count, rank, size) result(local_count)

総数 total_count をrankへ均等分割したときの局所個数を返す。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(in) :: total_count
integer(kind=i32), intent(in) :: rank
integer(kind=i32), intent(in) :: size

Return Value integer(kind=i32)


Subroutines

public subroutine mpi_initialize(ctx)

MPIを初期化して rank / size を取得する。非MPIビルドでは単一ランクを返す。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(out) :: ctx

public subroutine mpi_shutdown(ctx)

mpi_initialize が実際に初期化した場合のみ MPI_Finalize を呼ぶ。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(inout) :: ctx

public subroutine mpi_get_rank_size(rank, size, ctx)

mpi_context から rank/size を取得する。未指定時は単一rank(0/1)。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(out) :: rank
integer(kind=i32), intent(out) :: size
type(mpi_context), intent(in), optional :: ctx

public subroutine mpi_select_lowest_rank_i32_values(ctx, local_present, local_values, selected_rank, selected_values)

Select values supplied by the lowest MPI rank whose local flag is true.

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
logical, intent(in) :: local_present
integer(kind=i32), intent(in) :: local_values(:)
integer(kind=i32), intent(out) :: selected_rank
integer(kind=i32), intent(out) :: selected_values(:)

public subroutine mpi_allreduce_sum_real_dp_array(ctx, values)

倍精度配列の総和Allreduceをin-placeで実行する。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
real(kind=dp), intent(inout) :: values(:)

public subroutine mpi_allreduce_sum_real_dp_scalar(ctx, value)

倍精度スカラの総和Allreduceをin-placeで実行する。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
real(kind=dp), intent(inout) :: value

public subroutine mpi_allreduce_min_real_dp_array(ctx, values)

倍精度配列の最小値Allreduceをin-placeで実行する。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
real(kind=dp), intent(inout) :: values(:)

public subroutine mpi_allreduce_max_real_dp_array(ctx, values)

倍精度配列の最大値Allreduceをin-placeで実行する。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
real(kind=dp), intent(inout) :: values(:)

public subroutine mpi_allreduce_sum_i32_array(ctx, values)

32bit整数配列の総和Allreduceをin-placeで実行する。

Arguments

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

public subroutine mpi_allreduce_sum_i64_array(ctx, values)

64bit整数配列の総和Allreduceをin-placeで実行する。

Arguments

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

public subroutine mpi_allreduce_sum_i32_scalar(ctx, value)

32bit整数スカラの総和Allreduceをin-placeで実行する。

Arguments

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

public subroutine mpi_allreduce_min_i32_scalar(ctx, value)

32bit整数スカラの最小値Allreduceをin-placeで実行する。

Arguments

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

public subroutine mpi_allreduce_max_i32_scalar(ctx, value)

32bit整数スカラの最大値Allreduceをin-placeで実行する。

Arguments

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

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

public subroutine mpi_bcast_real_dp_array(ctx, values, root)

root rankの倍精度配列を全rankへbroadcastする。

Arguments

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

public subroutine mpi_gatherv_real_dp_array(ctx, local_values, global_values, root)

各rankの可変長倍精度配列をrootへrank順に連結する。

Read more…

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
real(kind=dp), intent(in) :: local_values(:)
real(kind=dp), intent(out), allocatable :: global_values(:)
integer(kind=i32), intent(in) :: root

public subroutine mpi_world_barrier(ctx)

全rankの同期ポイント。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx