@@ -58,6 +58,8 @@ Script options:
58
58
on the SLURM system; optional
59
59
-k, --no-chunk No parallelization, recommended for small domains
60
60
-p, --prefix=STR Prefix prepended to the output files
61
+ -b, --parsable Parsable SLURM message mainly used
62
+ for chained job submissions
61
63
-c, --cache=DIR Path of the cache directory; optional
62
64
-E, [email protected] E-mail user when job starts, ends, and finishes; optional
63
65
-V, --version Show version
@@ -113,7 +115,7 @@ shopt -s expand_aliases
113
115
# Parsing input arguments
114
116
# =======================
115
117
# argument parsing using getopt - WORKS ONLY ON LINUX BY DEFAULT
116
- parsedArguments=$( getopt -a -n extract-dataset -o jhVE :d:i:v:o:s:e:t:l:n:p:c:m:ka: --long submit-job,help,version,email:,dataset:,dataset-dir:,variable:,output-dir:,start-date:,end-date:,time-scale:,lat-lims:,lon-lims:,prefix:,cache:,ensemble:,no-chunk,shape-file: -- " $@ " )
118
+ parsedArguments=$( getopt -a -n extract-dataset -o jhVbE :d:i:v:o:s:e:t:l:n:p:c:m:ka: --long submit-job,help,version,parsable ,email:,dataset:,dataset-dir:,variable:,output-dir:,start-date:,end-date:,time-scale:,lat-lims:,lon-lims:,prefix:,cache:,ensemble:,no-chunk,shape-file: -- " $@ " )
117
119
validArguments=$?
118
120
# check if there is no valid options
119
121
if [ " $validArguments " != " 0" ]; then
148
150
-m | --ensemble) ensemble=" $2 " ; shift 2 ;; # optional
149
151
-k | --no-chunk) parallel=false ; shift ;; # optional
150
152
-p | --prefix) prefixStr=" $2 " ; shift 2 ;; # required
153
+ -b | --parsable) parsable=true ; shift ;; # optional
151
154
-c | --cache) cache=" $2 " ; shift 2 ;; # optional
152
155
-a | --shape-file) shapefile=" $2 " ; shift 2 ;; # optional
153
156
180
183
181
184
# email withought job submission not allowed
182
185
if [[ -n $email ]] && [[ -z $jobSubmission ]]; then
183
- echo " $( basename $0 ) : Email is not supported wihtout job submission;"
184
- echo " $( basename $0 ) : Continuing without email notification..."
186
+ echo " $( basename $0 ) : ERROR! Email is not supported wihtout job submission;"
187
+ exit 1;
188
+ fi
189
+
190
+ # parsable without job submission not allowed
191
+ if [[ $parsable == true ]] && [[ -z $jobSubmission ]]; then
192
+ echo " $( basename $0 ) : ERROR! --parsable argument cannot be used without job submission"
193
+ exit 1;
194
+ fi
195
+
196
+ # if parsable argument is provided
197
+ if [[ -n $parsable ]]; then
198
+ parsable=" --parsable"
199
+ else
200
+ parsable=" "
185
201
fi
186
202
187
203
# if shapefile is provided extract the extents from it
@@ -402,12 +418,13 @@ call_processing_func () {
402
418
#SBATCH --nodes=1
403
419
#SBATCH --account=rpp-kshook
404
420
#SBATCH --time=04:00:00
405
- #SBATCH --mem=8192M
421
+ #SBATCH --mem=8000M
406
422
#SBATCH --job-name=DATA_${scriptName}
407
423
#SBATCH --error=$logDir /datatool_%A-%a_err.txt
408
424
#SBATCH --output=$logDir /datatool_%A-%a.txt
409
425
#SBATCH --mail-user=$email
410
426
#SBATCH --mail-type=BEGIN,END,FAIL
427
+ #SBATCH ${parsable}
411
428
412
429
$( declare -p startDateArr)
413
430
$( declare -p endDateArr)
@@ -430,7 +447,9 @@ call_processing_func () {
430
447
srun ${script} --start-date="\$ tBegin" --end-date="\$ tEnd" --cache="${cache} -\$ {SLURM_ARRAY_JOB_ID}-\$ {SLURM_ARRAY_TASK_ID}" --ensemble="\$ {member}"
431
448
EOF
432
449
433
- echo " $( basename $0 ) : job submission details are printed under $logDir "
450
+ if [[ -z $parsable ]]; then
451
+ echo " $( basename $0 ) : job submission details are printed under $logDir "
452
+ fi
434
453
435
454
# serial run
436
455
else
0 commit comments