Skip to content

Commit 1d517c1

Browse files
luispedrowwood
authored andcommitted
mqsub_aqua: Add --array option
Creates a job array
1 parent d8ec43f commit 1d517c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bin/mqsub_aqua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ class script_format:
140140
if args.bg and not args.no_email and not args.command_file and not (args.chunk_num or args.chunk_size):
141141
print('#PBS -m ae',file=outfile) # disbled emailing when running chunks. Too spammy
142142
print('#PBS -M {}'.format(email),file=outfile)
143+
if args.array:
144+
# normalize array format so that both "x-y" and "y" are accepted (with the latter being expanded to "1-y")
145+
if '-' not in args.array:
146+
args.array = '1-{}'.format(args.array)
147+
print('#PBS -J {}'.format(args.array),file=outfile)
143148
if args.directive:
144149
print('#PBS {}'.format(args.directive),file=outfile)
145150
print('#PBS -q {}'.format(args.queue),file=outfile)
@@ -339,6 +344,7 @@ Example usage:
339344
parser.add_argument('--quiet', help='only output errors', action="store_true")
340345
parser.add_argument('-t','--cpus',default=1,type=int, help="Number of CPUs to queue job with [default: 1]")
341346
parser.add_argument('-g','--gpu',type=int,default=0, help="Number of GPUs to use [default: 0]")
347+
parser.add_argument('--array', help="Submit as an array job with the given number of tasks [default: Not used]")
342348
parser.add_argument('-m','--mem','--ram',type=int, help="GB of RAM to ask for [default: 8*num_cpus]")
343349
parser.add_argument('--directive', help="Arbitrary PBS directory to add e.g. '-l ngpus=1' to ask for a GPU [default: Not used]")
344350
parser.add_argument('-q','--queue', default='aqua', help="Name of queue to send to [default: aqua]")

0 commit comments

Comments
 (0)