From 7965730a91695d2fcd144a8a678a7c8d77ec3f6b Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 6 Nov 2023 11:30:56 +0000 Subject: [PATCH] Simulations will now start from scratch if restart==True but no checkpoint file is found --- src/somd2/runner/_runner.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/somd2/runner/_runner.py b/src/somd2/runner/_runner.py index b45758b..2b65b43 100644 --- a/src/somd2/runner/_runner.py +++ b/src/somd2/runner/_runner.py @@ -555,12 +555,17 @@ def _run(sim): ) if self._config.restart: - system = _stream.load( - str( - self._config.output_directory - / self._fnames[lambda_value]["checkpoint"] + try: + system = _stream.load( + str( + self._config.output_directory + / self._fnames[lambda_value]["checkpoint"] + ) + ).clone() + except: + _logger.warning( + f"Unable to load checkpoint file for λ={lambda_value}, starting from scratch." ) - ).clone() else: system = self._system.clone() if self._config.restart: