From bc698fec54cbb340c941d295e64a0e71b1cbae4a Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 2 Sep 2023 20:54:53 +0200 Subject: [PATCH] Allow manual verification before job submission --- slate/slate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slate/slate.py b/slate/slate.py index f761442..5596927 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -49,6 +49,7 @@ class Slate(): self.run_id = -1 self._tmp_path = os.path.expandvars('$TMP') self.sweep_id = None + self.verify = False def load_config(self, filename, name): config, stack = self._load_config(filename, name) @@ -232,6 +233,8 @@ class Slate(): num_parallel_jobs = min(self.consume(slurmC, 'num_parallel_jobs', num_jobs), num_jobs) array = f'0-{last_job_idx}%{num_parallel_jobs}' job = pyslurm.JobSubmitDescription(name=s_name, script=script, array=array, **slurmC) + if self.verify: + input(f'') job_id = job.submit() print(f'[>] Job submitted to slurm with id {job_id}') with open('job_hist.log', 'a') as f: @@ -393,6 +396,7 @@ class Slate(): parser.add_argument("-w", "--worker", action="store_true") parser.add_argument("-t", "--task_id", default=None, type=int) parser.add_argument("--sweep_id", default=None, type=str) + parser.add_argument("--ask_verify", action="store_true") args = parser.parse_args() @@ -405,6 +409,8 @@ class Slate(): assert args.config_file != None, 'Need to supply config file.' if args.slurm: + if args.ask_verify: + self.verify = True self.run_slurm(args.config_file, args.experiment) else: self.run_local(args.config_file, args.experiment, args.task_id, args.sweep_id)