diff --git a/src/xfel_calibrate/calibrate.py b/src/xfel_calibrate/calibrate.py index fa14605bf1068aa43b0e512332b607ed0afb0b74..103258b3f8d1836b95babc1470e1d8d23cc16a9e 100755 --- a/src/xfel_calibrate/calibrate.py +++ b/src/xfel_calibrate/calibrate.py @@ -263,11 +263,18 @@ def run_finalize( class SlurmOptions: def __init__( - self, job_name=None, nice=None, mem=None, partition=None, reservation=None, + self, + job_name=None, + nice=None, + mem=None, + mincpus=None, + partition=None, + reservation=None, ): self.job_name = job_name or 'xfel_calibrate' self.nice = nice self.mem = mem + self.mincpus = mincpus self.partition = partition self.reservation = reservation @@ -302,6 +309,9 @@ class SlurmOptions: if self.mem: launcher_slurm.append(f"--mem={self.mem}G") + if self.mincpus: + launcher_slurm.append(f"--mincpus={self.mincpus}") + deps = [] if after_ok: deps.append("afterok:" + ":".join(str(j) for j in after_ok)) @@ -833,6 +843,7 @@ def run(argv=None): job_name=args.get('slurm_name', 'xfel_calibrate'), nice=args['slurm_scheduling'], mem=args['slurm_mem'], + mincpus=args['slurm_mincpus'], reservation=args['reservation'], partition=args['slurm_partition'], )) diff --git a/src/xfel_calibrate/nb_args.py b/src/xfel_calibrate/nb_args.py index 93c6eba71ed8b0df2bbb22bcca83d2652a7434d0..45833dccfbb582c867e72de65d2b6f563969dad5 100644 --- a/src/xfel_calibrate/nb_args.py +++ b/src/xfel_calibrate/nb_args.py @@ -79,6 +79,10 @@ def make_initial_parser(**kwargs): parser.add_argument('--vector-figs', action="store_true", default=False, help="Use vector graphics for figures in the report.") + parser.add_argument('--slurm-mincpus', type=int, default=1, + help='Requested minimum number of ' + 'logical cpus/processors per node') + parser.add_argument('--slurm-mem', type=int, default=500, help="Requested node RAM in GB")