@@ -140,6 +140,11 @@ class script_format:
140
140
if args .bg and not args .no_email and not args .command_file and not (args .chunk_num or args .chunk_size ):
141
141
print ('#PBS -m ae' ,file = outfile ) # disbled emailing when running chunks. Too spammy
142
142
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 )
143
148
if args .directive :
144
149
print ('#PBS {}' .format (args .directive ),file = outfile )
145
150
print ('#PBS -q {}' .format (args .queue ),file = outfile )
@@ -339,6 +344,7 @@ Example usage:
339
344
parser .add_argument ('--quiet' , help = 'only output errors' , action = "store_true" )
340
345
parser .add_argument ('-t' ,'--cpus' ,default = 1 ,type = int , help = "Number of CPUs to queue job with [default: 1]" )
341
346
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]" )
342
348
parser .add_argument ('-m' ,'--mem' ,'--ram' ,type = int , help = "GB of RAM to ask for [default: 8*num_cpus]" )
343
349
parser .add_argument ('--directive' , help = "Arbitrary PBS directory to add e.g. '-l ngpus=1' to ask for a GPU [default: Not used]" )
344
350
parser .add_argument ('-q' ,'--queue' , default = 'aqua' , help = "Name of queue to send to [default: aqua]" )
0 commit comments