Skip to content

Commit 0ef4a45

Browse files
authored
Merge pull request #91 from OpenBioSim/fix_90
Fix issue #90
2 parents ebbd4a2 + a881ab2 commit 0ef4a45

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/somd2/runner/_runner.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ def generate_lam_vals(lambda_base, increment=0.001):
631631
# Store the checkpoint time in nanoseconds.
632632
checkpoint_interval = self._config.checkpoint_frequency.to("ns")
633633

634+
# Store the start time.
635+
start = _timer()
636+
634637
# Run the simulation, checkpointing in blocks.
635638
if self._config.checkpoint_frequency.value() > 0.0:
636639

@@ -645,9 +648,6 @@ def generate_lam_vals(lambda_base, increment=0.001):
645648
num_blocks = int(frac)
646649
rem = round(frac - num_blocks, 12)
647650

648-
# Store the star time.
649-
start = _timer()
650-
651651
# Run the dynamics in blocks.
652652
for block in range(int(num_blocks)):
653653
# Add the start block number.
@@ -938,6 +938,9 @@ def generate_lam_vals(lambda_base, increment=0.001):
938938
# Calculate the speed in nanoseconds per day.
939939
speed = time.to("ns") / days
940940

941+
# Create the lock.
942+
lock = _FileLock(self._lock_file)
943+
941944
# Acquire the file lock to ensure that the checkpoint files are
942945
# in a consistent state if read by another process.
943946
with lock.acquire(timeout=self._config.timeout.to("seconds")):

0 commit comments

Comments
 (0)