| 218 | 3) Substitute set |
| 219 | |
| 220 | See for instance the following section in platform.xml |
| 221 | |
| 222 | {{{ |
| 223 | <substituteset name="executesub"> |
| 224 | <iofile in="${submit_script}.in" out="$submit_script" /> |
| 225 | <sub source="#ENV#" dest="$env" /> |
| 226 | <sub source="#NOTIFY_EMAIL#" dest="" /> |
| 227 | <sub source="#BENCHNAME#" dest="$jube_benchmark_name" /> |
| 228 | <sub source="#NODELIST#" dest="nodes=$nodes:$nodetype:ppn=$taskspernode" /> |
| 229 | <sub source="#QUEUE#" dest="$queue" /> |
| 230 | <sub source="#JOBPOLICY#" dest="NACCESSPOLICY:SINGLEJOB" /> |
| 231 | <sub source="#TIME_LIMIT#" dest="$timelimit" /> |
| 232 | <sub source="#PREPROCESS#" dest="" /> |
| 233 | <sub source="#POSTPROCESS#" dest="" /> |
| 234 | <sub source="#STARTER#" dest="$starter" /> |
| 235 | <sub source="#ARGS_STARTER#" dest="$args_starter" /> |
| 236 | <sub source="#MEASUREMENT#" dest="" /> |
| 237 | <sub source="#STDOUTLOGFILE#" dest="$outlogfile" /> |
| 238 | <sub source="#STDERRLOGFILE#" dest="$errlogfile" /> |
| 239 | <sub source="#EXECUTABLE#" dest="" /> |
| 240 | <sub source="#ARGS_EXECUTABLE#" dest="" /> |
| 241 | <sub source="#FLAG#" dest="touch $done_file" /> |
| 242 | </substituteset> |
| 243 | }}} |
| 244 | |
| 245 | And in MAXW-DGTD-jube-master-SDV.modules.test.xml: |
| 246 | |
| 247 | {{{ |
| 248 | <substituteset name="executesub" init_with="platform.xml"> |
| 249 | <sub source="#NOTIFY_EMAIL#" dest="c.manzano@fz-juelich.de" /> |
| 250 | <sub source="#PREPROCESS#" dest="date +'(start) %F %T (%s)'; module purge; module load $modules; export LD_LIBRARY_PATH=/usr/local/deep-er/sdv-benchmarks/libraries/scr/lib:/direct/Software/Extoll/SDV/lib:/usr/local/parastation/pscom/lib64:$LD_LIBRARY_PATH; export OMP_NUM_THREADS=1; export KMP_AFFINITY='verbose,compact'; source exe/scr.sh; mkdir -p $iopath; cd exe" /> |
| 251 | <sub source="#POSTPROCESS#" dest="echo $LD_LIBRARY_PATH; echo $SCR_USER_NAME; echo $SCR_JOB_NAME; echo $SCR_JOB_ID; echo $SCR_CACHE_BASE; rm -rf $iopath; cd ..; date +'(finished) %F %T (%s)'" /> |
| 252 | <sub source="#EXECUTABLE#" dest="gdL$k" /> |
| 253 | <sub source="#ARGS_EXECUTABLE#" dest="" /> |
| 254 | </substituteset> |
| 255 | }}} |
| 256 | |
| 257 | This will tell JUBE to take the file ${submit_script}.in and create an output file named ${submit_script} with the occurrences #NOTIFY_EMAIL#, #QUEUE#, etc. substituted by the corresponding values. |
| 258 | |
| 259 | 4) Step execute |
| 260 | |
| 261 | NOTE: For integrating an application the step prepare is not necessary and won't be covered in this guide. A slightly modificated version of the xml file is explained here. |
| 262 | |
| 263 | {{{ |
| 264 | <step name="execute" shared="shared"> |
| 265 | <use>MAXW-DGTD-exec</use> |
| 266 | <use from="MAXW-DGTD_specs.xml">MAXW-DGTDInputFile</use> |
| 267 | <use>executeset</use> |
| 268 | <use>executesub</use> |
| 269 | <use from="platform.xml">chainsub</use> |
| 270 | <use>systemParameter</use> |
| 271 | <use tag="!woman">MAXW-DGTDParameter-head</use> |
| 272 | <use tag="woman">MAXW-DGTDParameter-woman</use> |
| 273 | <use>MAXW-DGTDInputSub</use> |
| 274 | <use>MAXW-DGTDSCRSub</use> |
| 275 | <use from="platform.xml">jobfiles</use> |
| 276 | <use from="platform.xml">chainfiles</use> |
| 277 | <do>mkdir exe; chgrp deeper exe; chmod g+s exe; cp -pr exe_$testcase/* exe/</do> |
| 278 | <do>cp -p gdL$k exe/</do> |
| 279 | <do>rm -f exe/Data_Num*; cp -p Data_Num.out exe/Data_Num</do> |
| 280 | <do>rm -f exe/Data_IO*; cp -p Data_IO.out exe/Data_IO</do> |
| 281 | <do>rm -f exe/scr.sh*; cp -p scr.sh.out exe/scr.sh</do> |
| 282 | <do>rm -f exe/test.part*; cp -p test.part.gz exe/; gzip -d exe/test.part.gz</do> |
| 283 | <do>$chainjob_script $shared_job_info $submit_script</do> |
| 284 | <do done_file="$done_file"></do> |
| 285 | <do>chgrp deeper job.log job.err</do> |
| 286 | </step> |
| 287 | }}} |
| 288 | |
| 289 | The interesting parts of this section are at the end. With |
| 290 | |
| 291 | {{{ |
| 292 | <do>$chainjob_script $shared_job_info $submit_script</do> |
| 293 | }}} |
| 294 | |
| 295 | you will submit a series of jobs (in this example 4, see section 2). The first job will run and the next one will wait until the first one is finished. The chainjob_script looks as follows: |
| 296 | |
| 297 | {{{ |
| 298 | cat /usr/local/jube2/platform/deep/deep-chainJobs.sh |
| 299 | |
| 300 | #!/usr/bin/env bash |
| 301 | |
| 302 | if [ $# -lt 2 ] |
| 303 | then |
| 304 | echo "$0: ERROR (MISSING ARGUMENTS)" |
| 305 | exit 1 |
| 306 | fi |
| 307 | |
| 308 | LOCKFILE=$1 |
| 309 | shift |
| 310 | SUBMITSCRIPT=$* |
| 311 | |
| 312 | |
| 313 | if [ -f $LOCKFILE ] |
| 314 | then |
| 315 | DEPEND_JOBID=`head -1 $LOCKFILE` |
| 316 | JOBID=`qsub -W depend=afterany:${DEPEND_JOBID} $SUBMITSCRIPT` |
| 317 | else |
| 318 | JOBID=`qsub $SUBMITSCRIPT` |
| 319 | fi |
| 320 | |
| 321 | echo ${JOBID} > $LOCKFILE |
| 322 | |
| 323 | exit 0 |
| 324 | }}} |
| 325 | |
| 326 | In shared_jobinfo the jobid of the preceding job is stored. Notice that |
| 327 | |
| 328 | {{{ |
| 329 | ${shared_jobinfo}=${shared_folder}/jobid=./shared/jobid |
| 330 | }}} |
| 331 | |
| 332 | and all jobs see the folder ./shared in the sandbox. |