Often you may wish to perform some preliminary manipulations on your data files before passing them on to your application for execution, and after that's done, you may wish to do some clean-up work, perhaps making sure that various scratch files have been removed, etc.
The way to do that is to use the second approach presented in the previous section, i.e., to submit a shell script to LoadLeveler.
Below is an example of a job like that. This job comprises three steps:
env and grep and the data file is constructed by running awk. The data file is written in the form of an
Emacs Lisp program.
llenv.el.
Of course, there are simpler ways to list LoadLeveler environmental variables, but this toy example neatly illustrates the idea of a three step procedure:
gustav@sp20:../LoadLeveler 23:23:59 !735 $ cat env.ll
# @ shell = /afs/ovpit.indiana.edu/@sys/gnu/bin/bash
# @ output = env.out
# @ error = env.err
# @ job_type = serial
# @ class = test
# @ notification = always
# @ environment = COPY_ALL
# @ queue
env | grep LOADL | \
awk ' BEGIN {
{ printf "(defun llenv ()\n" }
{ printf " (princ \"LoadLeveler variables:\\n\") " }
}
{ printf " (princ \"\t%s\\n\")\n", $0 }
END { print ")"} ' > llenv.el
emacs -batch -l llenv.el -f llenv > llenv.out
rm llenv.el
gustav@sp20:../LoadLeveler 23:24:18 !736 $
Having saved this LoadLeveler script on env.ll I have submitted it with
gustav@sp20:../LoadLeveler 23:24:44 !737 $ llsubmit env.ll submit: The job "sp20.32" has been submitted. gustav@sp20:../LoadLeveler 23:24:52 !738 $and then viewed the results of the run as follows:
gustav@sp20:../LoadLeveler 23:25:18 !739 $ cat llenv.out
LoadLeveler variables:
LOADL_STEP_GROUP=ucs
LOADL_JOB_NAME=sp20.ucs.indiana.edu.32
LOADL_STEP_NAME=0
LOADL_STEP_CLASS=test
LOADL_STEP_ID=sp20.ucs.indiana.edu.32.0
LOADL_STEP_OWNER=gustav
LOADL_ACTIVE=1.3.0.18
LOADL_STEP_ARGS=
LOADL_STEP_IN=/dev/null
LOADLBATCH=yes
LOADL_STEP_ERR=env.err
LOADL_STEP_ACCT=
LOADL_STEP_COMMAND=env.ll
LOADL_PROCESSOR_LIST=sp17.ucs.indiana.edu
LOADL_STARTD_PORT=9611
LOADL_STEP_NICE=0
LOADL_STEP_OUT=env.out
LOADL_STEP_TYPE=SERIAL
LOADL_STEP_INITDIR=/N/u/gustav/SP/LoadLeveler
gustav@sp20:../LoadLeveler 23:25:22 !740 $