Skip to content

Commit bdf8431

Browse files
Adding dependency feature
1 parent 830b5a6 commit bdf8431

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ is as follows:
5252
-p, --prefix=STR Prefix prepended to the output files
5353
-b, --parsable Parsable SLURM message mainly used
5454
for chained job submissions
55+
-D, --dependency Executation dependency submission ID, optional
5556
-c, --cache=DIR Path of the cache directory; optional
5657
defaults to $HOME/scratch
5758
-E, [email protected] E-mail user when job starts, ends, or

etc/schedulers/slurm.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
ifdef(`__PARTITION__', `#SBATCH --partition='__PARTITION__, `dnl')
1111
ifdef(`__ACCOUNT__', `#SBATCH --account='__ACCOUNT__, `dnl')
1212
ifdef(`__PARSABLE__', `#SBATCH '__PARSABLE__, `dnl')
13+
ifdef(`__DEPENDENCY__', `#SBATCH --dependency=afterok:'__DEPENDENCY__, `dnl')
1314
ifdef(`__EMAIL__',
1415
`#SBATCH --mail-user='__EMAIL__
1516
`#SBATCH --mail-type=BEGIN,END,FAIL',

extract-dataset.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Script options:
7676
-p, --prefix=STR Prefix prepended to the output files
7777
-b, --parsable Parsable SLURM message mainly used
7878
for chained job submissions
79+
-D, --dependency Executation dependency submission ID, optional
7980
-c, --cache=DIR Path of the cache directory; optional
8081
-E, [email protected] E-mail user when job starts, ends, or
8182
fails; optional
@@ -132,15 +133,15 @@ extract_submodel="$(dirname $0)/etc/scripts/extract_subdir_level.sh" # script pa
132133
parsedArguments=$( \
133134
getopt --alternative \
134135
--name "extract-dataset" \
135-
-o jhVbLE:d:i:v:o:s:e:t:l:n:p:c:m:M:S:ka:C:u: \
136+
-o jhVbLE:d:i:v:o:s:e:t:l:n:p:c:m:M:S:ka:C:u:D: \
136137
--long submit-job,help,version, \
137138
--long parsable,list-datasets,email:, \
138139
--long dataset:,dataset-dir:,variable:, \
139140
--long output-dir:,start-date:,end-date:, \
140141
--long time-scale:,lat-lims:,lon-lims:, \
141142
--long prefix:,cache:,ensemble:,model:, \
142143
--long scenario:,no-chunk,shape-file:, \
143-
--long cluster:,account: -- "$@" \
144+
--long cluster:,account:,dependency: -- "$@" \
144145
)
145146
validArguments=$?
146147
# check if there is no valid options
@@ -184,6 +185,7 @@ do
184185
-C | --cluster) cluster="$2" ; shift 2 ;; # required
185186
-a | --shape-file) shapefile="$2" ; shift 2 ;; # optional
186187
-u | --account) account="$2" ; shift 2 ;; # optional
188+
-D | --dependency) dependency="$2" ; shift 2 ;; # optional
187189

188190
# -- means the end of the arguments; drop this, and break out of the while loop
189191
--) shift; break ;;
@@ -582,6 +584,7 @@ function call_processing_func () {
582584
--arg "logDir" "$logDir" \
583585
--arg "email" "$email" \
584586
--arg "parsable" "$parsable" \
587+
--arg "dependency" "$dependency" \
585588
--argjson "specs" "$(jq -r '.specs' $cluster)" \
586589
'$ARGS.named + $specs | del(.specs)' \
587590
)"

0 commit comments

Comments
 (0)