Skip to content

Commit

Permalink
Prevent duplicate restart symlink creation
Browse files Browse the repository at this point in the history
  • Loading branch information
minghangli-uni committed Sep 16, 2024
1 parent a20f0ce commit aa7cdd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions expts_manager/Expts_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,13 @@ def _generate_restart_symlink(self, expt_path):
expt_path (str): The path to the experiment directory.
"""
if self.startfrom_str != "rest":
# if exisiting restarts and not force generating restart, then skip.
existing_restarts = glob.glob(
os.path.join(self.base_path, "archive", "restart*")
)
if existing_restarts and not self.force_restart:
return

link_restart = os.path.join("archive", "restart" + self.startfrom_str)
# restart dir from control experiment
restartpath = os.path.realpath(os.path.join(self.base_path, link_restart))
Expand Down

0 comments on commit aa7cdd5

Please sign in to comment.