begin_checkpoint_publish Subroutine

public subroutine begin_checkpoint_publish(out_dir)

checkpoint transactionのcompletion evidenceをrestart-bearing fileの置換前に無効化する。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: out_dir

Calls

proc~~begin_checkpoint_publish~~CallsGraph proc~begin_checkpoint_publish begin_checkpoint_publish proc~atomic_rename atomic_rename proc~begin_checkpoint_publish->proc~atomic_rename

Called by

proc~~begin_checkpoint_publish~~CalledByGraph proc~begin_checkpoint_publish begin_checkpoint_publish proc~write_checkpoint_state_files write_checkpoint_state_files proc~write_checkpoint_state_files->proc~begin_checkpoint_publish proc~write_result_files write_result_files proc~write_result_files->proc~begin_checkpoint_publish proc~maybe_write_periodic_checkpoint maybe_write_periodic_checkpoint proc~maybe_write_periodic_checkpoint->proc~write_checkpoint_state_files program~main main program~main->proc~write_result_files

Source Code

  subroutine begin_checkpoint_publish(out_dir)
    character(len=*), intent(in) :: out_dir

    character(len=1024) :: path, temporary_path
    integer :: u, ios, rename_status

    path = trim(out_dir)//'/'//checkpoint_manifest_name
    temporary_path = trim(path)//'.tmp'
    open (newunit=u, file=trim(temporary_path), status='replace', action='write', iostat=ios)
    if (ios /= 0) error stop 'Failed to create temporary checkpoint manifest.'
    write (u, '(a,i0)') 'schema_version=', checkpoint_manifest_schema_current
    write (u, '(a)') 'state=in_progress'
    close (u, iostat=ios)
    if (ios /= 0) error stop 'Failed to close temporary checkpoint manifest.'
    call atomic_rename(trim(temporary_path), trim(path), rename_status)
    if (rename_status /= filesystem_success) error stop 'Failed to invalidate checkpoint manifest.'
  end subroutine begin_checkpoint_publish