restart_rng_state_path Function

public function restart_rng_state_path(out_dir, mpi_rank, mpi_size, mpi) result(path)

RNG状態ファイルのパスを返す。MPI複数rank時は rank 接尾辞付きパスへ切り替える。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: out_dir
integer(kind=i32), intent(in), optional :: mpi_rank
integer(kind=i32), intent(in), optional :: mpi_size
type(mpi_context), intent(in), optional :: mpi

Return Value character(len=1024)


Calls

proc~~restart_rng_state_path~~CallsGraph proc~restart_rng_state_path restart_rng_state_path proc~mpi_get_rank_size mpi_get_rank_size proc~restart_rng_state_path->proc~mpi_get_rank_size

Called by

proc~~restart_rng_state_path~~CalledByGraph proc~restart_rng_state_path restart_rng_state_path proc~load_restart_checkpoint load_restart_checkpoint proc~load_restart_checkpoint->proc~restart_rng_state_path proc~write_rng_state_file write_rng_state_file proc~write_rng_state_file->proc~restart_rng_state_path proc~load_or_init_run_state load_or_init_run_state proc~load_or_init_run_state->proc~load_restart_checkpoint program~main main program~main->proc~write_rng_state_file program~main->proc~load_or_init_run_state

Source Code

  function restart_rng_state_path(out_dir, mpi_rank, mpi_size, mpi) result(path)
    character(len=*), intent(in) :: out_dir
    integer(i32), intent(in), optional :: mpi_rank, mpi_size
    type(mpi_context), intent(in), optional :: mpi
    character(len=1024) :: path
    integer(i32) :: local_rank, world_size

    call resolve_parallel_rank_size(local_rank, world_size, mpi_rank, mpi_size, mpi, 'restart_rng_state_path')
    if (world_size <= 1_i32) then
      path = trim(out_dir)//'/rng_state.txt'
    else
      write (path, '(a,a,i5.5,a)') trim(out_dir), '/rng_state_rank', local_rank, '.txt'
    end if
  end function restart_rng_state_path