示例#1
0
def _check_needed_restart(op, args):
    # Assert that we're restarting something that exists.
    assert os.path.exists(op.run_dir), op.run_dir
    run_id = os.path.basename(op.run_dir)
    assert run_id.startswith(args.restart), (run_id, args.restart)
    run = runlib.Run(run_id, op.run_dir)
    if not op_util.restart_needed(run, op.flag_vals):
        cli.out("Skipping run because flags have not changed "
                "(--needed specified)")
        raise SystemExit(0)
示例#2
0
 def run_needed(self):
     run = self.trial_run()
     if not run:
         return True
     return op_util.restart_needed(run, self.flags)