Skip to content

Commit

Permalink
Timing information at INFO logging level. Users will get it by defaul…
Browse files Browse the repository at this point in the history
…t. (#673)

Co-authored-by: Mike Henry <[email protected]>
  • Loading branch information
ijpulidos and mikemhenry authored Mar 31, 2023
1 parent 139b454 commit a408bed
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions openmmtools/multistate/multistatesampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,14 +790,13 @@ def run(self, n_iterations=None):
partial_total_time = timer.partial('Run ReplicaExchange')
self._update_timing(iteration_time, partial_total_time, run_initial_iteration, iteration_limit)

# Show timing statistics if debug level is activated.
if logger.isEnabledFor(logging.DEBUG):
logger.debug("Iteration took {:.3f}s.".format(self._timing_data["iteration_seconds"]))
if self._timing_data["estimated_time_remaining"] != float('inf'):
logger.debug("Estimated completion in {}, at {} (consuming total wall clock time {}).".format(
self._timing_data["estimated_time_remaining"],
self._timing_data["estimated_localtime_finish_date"],
self._timing_data["estimated_total_time"]))
# Log timing data as info level -- useful for users by default
logger.info("Iteration took {:.3f}s.".format(self._timing_data["iteration_seconds"]))
if self._timing_data["estimated_time_remaining"] != float('inf'):
logger.info("Estimated completion in {}, at {} (consuming total wall clock time {}).".format(
self._timing_data["estimated_time_remaining"],
self._timing_data["estimated_localtime_finish_date"],
self._timing_data["estimated_total_time"]))

# Perform sanity checks to see if we should terminate here.
self._check_nan_energy()
Expand Down

0 comments on commit a408bed

Please sign in to comment.