mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Get starting time in Model.run based on filesystem. Closes #1939
This commit is contained in:
parent
badaaacca4
commit
424f26f697
1 changed files with 7 additions and 3 deletions
|
|
@ -1,10 +1,11 @@
|
|||
from collections.abc import Iterable
|
||||
from contextlib import contextmanager
|
||||
from functools import lru_cache
|
||||
import os
|
||||
from pathlib import Path
|
||||
from numbers import Integral
|
||||
from tempfile import NamedTemporaryFile
|
||||
import time
|
||||
from contextlib import contextmanager
|
||||
|
||||
import h5py
|
||||
|
||||
|
|
@ -528,8 +529,11 @@ class Model:
|
|||
"""
|
||||
|
||||
# Setting tstart here ensures we don't pick up any pre-existing
|
||||
# statepoint files in the output directory
|
||||
tstart = time.time()
|
||||
# statepoint files in the output directory -- just in case there are
|
||||
# differences between the system clock and the filesystem, we get the
|
||||
# time of a just-created temporary file
|
||||
with NamedTemporaryFile() as fp:
|
||||
tstart = Path(fp.name).stat().st_mtime
|
||||
last_statepoint = None
|
||||
|
||||
# Operate in the provided working directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue