|
20 | 20 | LOGS_FOLDERNAME = "SMART_DISPATCH_LOGS" |
21 | 21 | CLUSTER_NAME = utils.detect_cluster() |
22 | 22 | AVAILABLE_QUEUES = get_available_queues(CLUSTER_NAME) |
| 23 | +LAUNCHER = utils.get_launcher(CLUSTER_NAME) |
23 | 24 |
|
24 | 25 |
|
25 | 26 | def main(): |
@@ -85,14 +86,15 @@ def main(): |
85 | 86 | # Launch the jobs with QSUB |
86 | 87 | if not args.doNotLaunch: |
87 | 88 | for pbs_filename in pbs_filenames: |
88 | | - qsub_output = check_output('qsub ' + 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) |
89 | 90 | print qsub_output, |
90 | 91 |
|
91 | 92 |
|
92 | 93 | def parse_arguments(): |
93 | 94 | parser = argparse.ArgumentParser() |
94 | 95 | parser.add_argument('-q', '--queueName', required=True, help='Queue used (ex: qwork@mp2, qfat256@mp2, qfat512@mp2)') |
95 | 96 | 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') |
96 | 98 | parser.add_argument('-C', '--coresPerNode', type=int, required=False, help='How many cores there are per node.') |
97 | 99 | parser.add_argument('-G', '--gpusPerNode', type=int, required=False, help='How many gpus there are per node.') |
98 | 100 | #parser.add_argument('-M', '--memPerNode', type=int, required=False, help='How much memory there are per node (in Gb).') |
@@ -121,7 +123,7 @@ def parse_arguments(): |
121 | 123 | if args.commandsFile is None and len(args.commandAndOptions) < 1: |
122 | 124 | parser.error("You need to specify a command to launch.") |
123 | 125 | if args.queueName not in AVAILABLE_QUEUES and ((args.coresPerNode is None and args.gpusPerNode is None) or args.walltime is None): |
124 | | - parser.error("Unknown queue, --coresPerCommand/--gpusPerCommand and --walltime must be set.") |
| 126 | + parser.error("Unknown queue, --coresPerNode/--gpusPerNode and --walltime must be set.") |
125 | 127 | else: |
126 | 128 | if args.pool is None: |
127 | 129 | resume_parser.error("The resume feature only works with the --pool argument.") |
|
0 commit comments