Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/somd2/runner/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def __init__(self, system, config):

# Flag whether frames are being saved.
if (
self._config.frame_frequency > 0
self._config.save_trajectories
and self._config.frame_frequency > 0
and self._config.frame_frequency <= self._config.runtime
):
self._save_frames = True
Expand Down Expand Up @@ -1241,7 +1242,6 @@ def _compare_configs(config1, config2):
"equilibration_timestep",
"equilibration_constraints",
"energy_frequency",
"save_trajectory",
"frame_frequency",
"save_velocities",
"platform",
Expand Down Expand Up @@ -1646,15 +1646,17 @@ def _checkpoint(
_copyfile(traj_filename, f"{traj_filename}.prev")
traj_chunks = [f"{traj_filename}.prev"] + traj_chunks

# Load the topology and chunked trajectory files.
mols = _sr.load([topology0] + traj_chunks)
# Make sure there are trajectory chunks to process.
if len(traj_chunks) > 0:
# Load the topology and chunked trajectory files.
mols = _sr.load([topology0] + traj_chunks)

# Save the final trajectory to a single file.
_sr.save(mols.trajectory(), traj_filename, format=["DCD"])
# Save the final trajectory to a single file.
_sr.save(mols.trajectory(), traj_filename, format=["DCD"])

# Now remove the chunked trajectory files.
for chunk in traj_chunks:
_Path(chunk).unlink()
# Now remove the chunked trajectory files.
for chunk in traj_chunks:
_Path(chunk).unlink()

# Add config and lambda value to the system properties.
system.set_property("config", self._config.as_dict(sire_compatible=True))
Expand Down