bem_performance_profile Module

実行フェーズごとの壁時計計測と MPI 集約出力を担う軽量プロファイラ。


Uses

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

Used by

  • module~~bem_performance_profile~~UsedByGraph module~bem_performance_profile bem_performance_profile module~bem_simulator_loop bem_simulator_loop module~bem_simulator_loop->module~bem_performance_profile program~main main program~main->module~bem_performance_profile

Variables

Type Visibility Attributes Name Initial
integer(kind=i32), public, parameter :: perf_region_program_total = 1_i32
integer(kind=i32), public, parameter :: perf_region_load_or_init = 2_i32
integer(kind=i32), public, parameter :: perf_region_history_open = 3_i32
integer(kind=i32), public, parameter :: perf_region_simulation_total = 4_i32
integer(kind=i32), public, parameter :: perf_region_field_solver_init = 5_i32
integer(kind=i32), public, parameter :: perf_region_batch_total = 6_i32
integer(kind=i32), public, parameter :: perf_region_prepare_batch = 7_i32
integer(kind=i32), public, parameter :: perf_region_field_refresh = 8_i32
integer(kind=i32), public, parameter :: perf_region_particle_batch = 9_i32
integer(kind=i32), public, parameter :: perf_region_commit_charge = 10_i32
integer(kind=i32), public, parameter :: perf_region_count_outcomes = 11_i32
integer(kind=i32), public, parameter :: perf_region_mpi_reduce = 12_i32
integer(kind=i32), public, parameter :: perf_region_stats_update = 13_i32
integer(kind=i32), public, parameter :: perf_region_history_write = 14_i32
integer(kind=i32), public, parameter :: perf_region_write_results = 15_i32
integer(kind=i32), public, parameter :: perf_region_write_checkpoint = 16_i32
integer(kind=i32), public, parameter :: perf_region_count = 16_i32

Functions

public function perf_is_enabled()

粗粒度プロファイルが有効かを返す。

Arguments

None

Return Value logical

public function perf_wall_time_seconds()

OpenMP有効時は omp_get_wtime、それ以外は system_clock を使う壁時計。

Arguments

None

Return Value real(kind=dp)


Subroutines

public subroutine perf_reset()

プロファイラ状態を既定値へ戻す。

Arguments

None

public subroutine perf_configure(enabled)

明示フラグで計測状態を設定する。

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: enabled

public subroutine perf_configure_from_env()

環境変数 BEACH_PROFILE から計測状態を初期化する。

Arguments

None

public subroutine perf_set_output_context(output_dir, write_files)

出力先ディレクトリとファイル書き出し可否を登録する。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: output_dir
logical, intent(in) :: write_files

public subroutine perf_region_begin(region_id, t0)

フェーズ開始時刻を取得する。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(in) :: region_id
real(kind=dp), intent(out) :: t0

public subroutine perf_region_end(region_id, t0)

フェーズ終了時刻との差分を累積する。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(in) :: region_id
real(kind=dp), intent(in) :: t0

public subroutine perf_add_elapsed(region_id, elapsed_s, call_count)

経過時間と呼び出し回数を累積する。

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(in) :: region_id
real(kind=dp), intent(in) :: elapsed_s
integer(kind=i32), intent(in), optional :: call_count

public subroutine perf_write_outputs(mpi)

集計済みプロファイルを標準出力および CSV へ書き出す。

Arguments

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