Skip to content

Commit

Permalink
Add walltime arg to BatchArgumentParser
Browse files Browse the repository at this point in the history
  • Loading branch information
taranu committed Jan 15, 2020
1 parent 7011481 commit f2205f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/lsst/ctrl/pool/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ def __init__(self, parent=None, *args, **kwargs):
group.add_argument("--cores", type=int, default=0, help="Number of cores (Slurm/SMP only)")
group.add_argument("--time", type=float, default=0,
help="Expected execution time per element (sec)")
group.add_argument("--walltime", type=float, default=0,
help="Expected total execution walltime (sec); overrides cores & time")
group.add_argument("--batch-type", dest="batchType", choices=list(BATCH_TYPES.keys()), default="smp",
help="Batch system to use")
group.add_argument("--batch-verbose", dest="batchVerbose", action="store_true", default=False,
Expand Down Expand Up @@ -446,8 +448,11 @@ def parseAndSubmit(cls, args=None, **kwargs):

return cls.parseAndRun()
else:
numCores = batchArgs.cores if batchArgs.cores > 0 else batchArgs.nodes*batchArgs.procs
walltime = cls.batchWallTime(batchArgs.time, batchArgs.parent, numCores)
if batchArgs.walltime > 0:
walltime = batchArgs.walltime
else:
numCores = batchArgs.cores if batchArgs.cores > 0 else batchArgs.nodes*batchArgs.procs
walltime = cls.batchWallTime(batchArgs.time, batchArgs.parent, numCores)

command = cls.batchCommand(batchArgs)
batchArgs.batch.run(command, walltime=walltime)
Expand Down

0 comments on commit f2205f3

Please sign in to comment.