Skip to content

Commit

Permalink
Check restart file exists near start of --restart job.
Browse files Browse the repository at this point in the history
This should save some time.
  • Loading branch information
rwest committed Apr 21, 2013
1 parent 60ed251 commit aeb076a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rmgpy/rmg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
Generator (RMG).
"""

import os
import os.path
import sys
import logging
Expand Down Expand Up @@ -232,6 +233,11 @@ def initialize(self, args):
self.outputDirectory = args.output_directory
self.scratchDirectory = args.scratch_directory

if args.restart:
if not os.path.exists(os.path.join(self.outputDirectory,'restart.pkl')):
logging.error("Could not find restart file (restart.pkl). Please run without --restart option.")
raise Exception("No restart file")

# Read input file
self.loadInput(args.file[0])

Expand All @@ -240,7 +246,6 @@ def initialize(self, args):

# See if memory profiling package is available
try:
import os
import psutil
except ImportError:
logging.info('Optional package dependency "psutil" not found; memory profiling information will not be saved.')
Expand Down

0 comments on commit aeb076a

Please sign in to comment.