Skip to content

Commit ca426c4

Browse files
committed
Added commandline support for launcher.
Also fixed a typo
1 parent c405dfd commit ca426c4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

SMART_DISPATCH_LOGS/echo_wop/commands/commands.txt

Whitespace-only changes.

scripts/smart_dispatch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ def main():
8686
# Launch the jobs with QSUB
8787
if not args.doNotLaunch:
8888
for pbs_filename in pbs_filenames:
89-
qsub_output = check_output('{launcher} {pbs_filename}'.format(launcher=LAUNCHER, pbs_filename=pbs_filename), shell=True)
89+
qsub_output = check_output('{launcher} {pbs_filename}'.format(launcher=LAUNCHER if args.launcher is None else args.launcher, pbs_filename=pbs_filename), shell=True)
9090
print qsub_output,
9191

9292

9393
def parse_arguments():
9494
parser = argparse.ArgumentParser()
9595
parser.add_argument('-q', '--queueName', required=True, help='Queue used (ex: qwork@mp2, qfat256@mp2, qfat512@mp2)')
9696
parser.add_argument('-t', '--walltime', required=False, help='Set the estimated running time of your jobs using the DD:HH:MM:SS format. Note that they will be killed when this time limit is reached.')
97+
parser.add_argument('-L', '--launcher', choices=['qsub', 'msub'], required=False, help='Which launcher to use. Default: qsub')
9798
parser.add_argument('-C', '--coresPerNode', type=int, required=False, help='How many cores there are per node.')
9899
parser.add_argument('-G', '--gpusPerNode', type=int, required=False, help='How many gpus there are per node.')
99100
#parser.add_argument('-M', '--memPerNode', type=int, required=False, help='How much memory there are per node (in Gb).')
@@ -122,7 +123,7 @@ def parse_arguments():
122123
if args.commandsFile is None and len(args.commandAndOptions) < 1:
123124
parser.error("You need to specify a command to launch.")
124125
if args.queueName not in AVAILABLE_QUEUES and ((args.coresPerNode is None and args.gpusPerNode is None) or args.walltime is None):
125-
parser.error("Unknown queue, --coresPerCommand/--gpusPerCommand and --walltime must be set.")
126+
parser.error("Unknown queue, --coresPerNode/--gpusPerNode and --walltime must be set.")
126127
else:
127128
if args.pool is None:
128129
resume_parser.error("The resume feature only works with the --pool argument.")

0 commit comments

Comments
 (0)