From bc5daae33ff08fe21afb452e1b7503698613d529 Mon Sep 17 00:00:00 2001 From: Jeremy Auguste <jeremy.auguste@dhcp-177.lidil.univ-mrs.fr> Date: Tue, 20 Feb 2018 11:28:04 +0100 Subject: [PATCH] Added possibility to set minutes and seconds --- oargen.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/oargen.py b/oargen.py index abd72c2..b0460d4 100755 --- a/oargen.py +++ b/oargen.py @@ -19,8 +19,8 @@ def argparser(): help="Name to give to the job") parser.add_argument('-b', '--besteffort', action="store_true", help="Launch job in besteffort mode") - parser.add_argument('-t', '--time', default=12, type=int, - help="Estimated maximum duration of the job (in hours)") + parser.add_argument('-t', '--time', default=[12], type=int, nargs="+", + help="Estimated maximum duration of the job (format: h [m [s]])") parser.add_argument('-g', '--gpu', action="store_true", help="If True, reserves only cores with GPUs") parser.add_argument('-c', '--core', default=1, type=int, @@ -62,7 +62,10 @@ def main(): command.append(properties) command.append("-l") - ressources = "core={},walltime={}:00:00".format(args.core, args.time) + hour = args.time[0] + minutes = args.time[1] if len(args.time) >= 2 else 0 + seconds = args.time[2] if len(args.time) >= 3 else 0 + ressources = "core={},walltime={}:{}:{}".format(args.core, hour, minutes, seconds) command.append(ressources) if args.name is not None: -- GitLab