@@ -75,6 +75,8 @@ Script options:
75
75
must be comma delimited float numbers between
76
76
0 and 1; optional [defaults to every 5th quantile]
77
77
-p, --prefix=STR Prefix prepended to the output files
78
+ -b, --parsable Parsable SLURM message mainly used
79
+ for chained job submissions
78
80
-c, --cache=DIR Path of the cache directory; optional
79
81
-E, --email=STR E-mail when job starts, ends, and
80
82
fails; optional
@@ -114,7 +116,7 @@ shopt -s expand_aliases
114
116
# ATTENTION: `getopt` is available by default on most GNU/Linux
115
117
# distributions, however, it may not work out of the
116
118
# box on MacOS or BSD
117
- parsedArguments=$( getopt -a -n extract-geotiff -o d:i:r:v:o:s:e:l:n:f:jt:a:uq:p:c:EVh --long dataset:,dataset-dir:,crs:,variable:,output-dir:,start-date:,end-date:,lat-lims:,lon-lims:,shape-file:,submit-job,print-geotiff:,stat:,include-na,quantile:,prefix:,cache:,email:,version,help -- " $@ " )
119
+ parsedArguments=$( getopt -a -n extract-geotiff -o d:i:r:v:o:s:e:l:n:f:jt:a:uq:p:c:E:Vhb --long dataset:,dataset-dir:,crs:,variable:,output-dir:,start-date:,end-date:,lat-lims:,lon-lims:,shape-file:,submit-job,print-geotiff:,stat:,include-na,quantile:,prefix:,cache:,email:,version,help,parsable -- " $@ " )
118
120
validArguments=$?
119
121
# check if there is no valid options
120
122
if [ " $validArguments " != " 0" ]; then
149
151
-u | --include-na) includeNA=true ; shift ;; # optional
150
152
-q | --quantile) quantiles=" $2 " ; shift 2 ;; # optional
151
153
-p | --prefix) prefixStr=" $2 " ; shift 2 ;; # required
154
+ -b | --parsable) parsable=true ; shift ;; # optional
152
155
-c | --cache) cache=" $2 " ; shift 2 ;; # optional
153
156
-E | --email) email=" $2 " ; shift 2 ;; # optional
154
157
-V | --version) version ; shift ;; # optional
@@ -216,6 +219,20 @@ if [[ -n $email ]] && [[ -z $jobSubmission ]]; then
216
219
echo " $( basename $0 ) : Continuing without email notification..."
217
220
fi
218
221
222
+ # parsable without job submission not allowed
223
+ if [[ -n $parsable ]] && [[ -z $jobSubmission ]]; then
224
+ echo " $( basename $0 ) : ERROR! --parsable argument cannot be used" \
225
+ " without job submission"
226
+ exit 1;
227
+ fi
228
+
229
+ # if parsable argument is provided
230
+ if [[ -n $parsable ]]; then
231
+ parsable=" --parsable"
232
+ else
233
+ parsable=" "
234
+ fi
235
+
219
236
# either shapefile or spatial extents arguments are allowed
220
237
if [[ -n $shapefile ]] && [[ -n $latLims ]]; then
221
238
echo " $( basename $0 ) : ERROR! Either shapefile or spatial extents should be entered"
@@ -302,17 +319,20 @@ call_processing_func () {
302
319
#SBATCH --nodes=1
303
320
#SBATCH --account=rpp-kshook
304
321
#SBATCH --time=04:00:00
305
- #SBATCH --mem=16GB
322
+ #SBATCH --mem=16000MB
306
323
#SBATCH --job-name=GIS_${scriptName}
307
324
#SBATCH --error=$logDir /GIS_%j_err.txt
308
325
#SBATCH --output=$logDir /GIS_%j.txt
309
326
#SBATCH --mail-user=$email
310
327
#SBATCH --mail-type=BEGIN,END,FAIL
328
+ #SBATCH ${parsable}
311
329
312
330
srun ${scriptRun} --cache="${cache} -\$ {SLURM_JOB_ID}"
313
331
EOF
314
332
# echo message
315
- echo " $( basename $0 ) : job submission details are printed under ${logDir} "
333
+ if [[ -z parsable ]]; then
334
+ echo " $( basename $0 ) : job submission details are printed under ${logDir} "
335
+ fi
316
336
317
337
else
318
338
eval " $scriptRun "
0 commit comments