diff --git a/src/somd2/runner/_repex.py b/src/somd2/runner/_repex.py index f8730ad..7b1c20e 100644 --- a/src/somd2/runner/_repex.py +++ b/src/somd2/runner/_repex.py @@ -267,10 +267,14 @@ def run(self): """ from math import ceil + from time import time from concurrent.futures import ThreadPoolExecutor as _ThreadPoolExecutor from itertools import repeat as _repeat + # Record the start time. + start = time() + # Work out the number of repex cycles. cycles = ceil(self._config.runtime / self._config.energy_frequency) @@ -407,6 +411,12 @@ def run(self): if is_checkpoint: block += 1 + # Record the end time. + end = time() + + # Log the run time in minutes. + _logger.success(f"Simulation finished. Run time: {(end - start) / 60:.2f} minutes") + def _run_block( self, index, lambdas, is_checkpoint, is_final_block, block, num_blocks ): diff --git a/src/somd2/runner/_runner.py b/src/somd2/runner/_runner.py index bafa24f..a42e9cf 100644 --- a/src/somd2/runner/_runner.py +++ b/src/somd2/runner/_runner.py @@ -131,15 +131,12 @@ def _zero_gpu_devices(devices): def run(self): """ Use concurrent.futures to run lambda windows in parallel + """ - Returns - -------- + from time import time - results : [bool] - List of simulation results. (Currently whether the simulation finished - successfully or not.) - """ - results = self._manager.list() + # Record the start time. + start = time() # Create shared resources. self._create_shared_resources() @@ -184,8 +181,6 @@ def run(self): _logger.error( f"Exception raised for {_lam_sym} = {lambda_value}: {e}" ) - with self._lock: - results.append(result) # Kill all current and future jobs if keyboard interrupt. except KeyboardInterrupt: @@ -193,7 +188,11 @@ def run(self): for pid in executor._processes: executor._processes[pid].terminate() - return results + # Record the end time. + end = time() + + # Log the run time in minutes. + _logger.success(f"Simulation finished. Run time: {(end - start) / 60:.2f} minutes") def run_window(self, index): """