next up previous index
Next: Submitting a Simple Sequential Up: Specification of LoadLeveler Jobs Previous: Interactive LoadLeveler Jobs

Submitting a not quite interactive job

There is a class of jobs, which many users who lack UNIX skills think of as interactive jobs, but, which, in fact, aren't interactive at all. Applications which take input from a command line in some sort of an application dependent language fall in that category. Examples are Common Lisp, Smalltalk, Scheme, Octave, Matlab, Mathematica, Xplor, GeneHunter, etc.

Often a user has a command file prepared, which must be loaded into an application from an interactive session. Once the command file is loaded the application begins executing a program, which may take hours to complete. A user at that stage goes away leaving an active telnet connection or an X11 window on the display. The window was needed only to load the file and perhaps issue some start-up commands for the computation.

Jobs like that are not interactive at all and they can and should be run under LoadLeveler without asking for an xterm window and forking an unnecessary login shell.

The way to execute such jobs is to use the here-input feature of UNIX shells:

$ my_command << EOF
   one_line_of_input
   another_line_of_input
EOF

Here is an example:

# @ shell = /afs/ovpit.indiana.edu/@sys/gnu/bin/bash
# @ output = hello-lisp.out
# @ error = hello-lisp.err
# @ job_type = serial
# @ class = test
# @ notification = always
# @ environment = COPY_ALL
# @ queue
clisp -q << EOF
(load "hello.fas")
(hello)
EOF

Here I have a Common Lisp program stored on a file hello.fas. Normally, in order to execute that program I would have to enter a Common Lisp environment with the command clisp. Then I would have to load the file which contains the program, and finally I would have to evaluate the function, which has been defined on hello.fas, by typing (hello).

But all that can be accomplished also by typing

clisp -q << EOF
(load "hello.fas")
(hello)
EOF

in a shell script without having to invoke xterm first. A UNIX shell (csh, tcsh, sh, ksh or bash) on encountering a construct like that will take the text enclosed by the

<< EOF
...
EOF
construct and will pass it to the program, in this case clisp, as if it has been typed in by the user.

Long Matlab, GeneHunter, Xplor, etc., computations can and should be run like this too.


next up previous index
Next: Submitting a Simple Sequential Up: Specification of LoadLeveler Jobs Previous: Interactive LoadLeveler Jobs
Zdzislaw Meglicki
2001-02-26