base directory直下の最終出力と両定期slotを比較し、batch数が新しい完全checkpointを返す。 indexは同batchのslotを選ぶtie-breakにだけ使う。欠落、破損、古いindexは complete manifestを持つload可能なslotの回収を妨げない。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | base_dir | |||
| character(len=*), | intent(out) | :: | checkpoint_dir |
subroutine resolve_latest_checkpoint_dir(base_dir, checkpoint_dir) character(len=*), intent(in) :: base_dir character(len=*), intent(out) :: checkpoint_dir integer(i32) :: root_batch, slot_batch, recovered_slot logical :: root_complete, slot_found character(len=1024) :: slot_dir checkpoint_dir = trim(base_dir) call inspect_checkpoint_directory(trim(base_dir), root_complete, batches=root_batch) if (.not. root_complete) root_batch = -1_i32 call find_latest_periodic_slot(trim(base_dir), recovered_slot, slot_batch, slot_found) if (.not. slot_found) return slot_dir = checkpoint_slot_dir(trim(base_dir), recovered_slot) if (slot_batch > root_batch) checkpoint_dir = trim(slot_dir) end subroutine resolve_latest_checkpoint_dir