LSF Version 7.3 - Administering Platform LSF

Configuring Pre- and Post-Execution Commands
564 Administering Platform LSF
If the pre-execution command exits with a non-zero exit code, it is considered
to have failed, and the job is requeued to the head of the queue. Use this feature
to implement customized scheduling by having the pre-execution command
fail if conditions for dispatching the job are not met.
Example Begin Application
NAME = catia
DESCRIPTION = CATIA V5
CPULIMIT = 24:0/hostA # 24 hours of host hostA
FILELIMIT = 20000
DATALIMIT = 20000 # jobs data segment limit
CORELIMIT = 20000
PROCLIMIT = 5 # job processor limit
PRE_EXEC = /usr/share/lsf/catia_prexec
POST_EXEC = /usr/share/lsf/catia_postexec
REQUEUE_EXIT_VALUES = 55 34 78
End Application
See the lsb.applications template file for additional application profile
examples.
Pre- and post-execution on UNIX and Linux
The entire contents of the configuration line of the pre- and post-execution
commands are run under
/bin/sh -c, so shell features can be used in the
command.
For example, the following is valid:
PRE_EXEC = /usr/share/lsf/misc/testq_pre >> /tmp/pre.out
POST_EXEC = /usr/share/lsf/misc/testq_post | grep -v "Hey!"
The pre- and post-execution commands are run in /tmp.
Standard input and standard output and error are set to
/dev/null. The output
from the pre- and post-execution commands can be explicitly redirected to a file for
debugging purposes.
The PATH environment variable is set to:
PATH='/bin /usr/bin /sbin /usr/sbin'
Pre- and post-execution on Windows
The pre- and post-execution commands are run under cmd.exe /c.
NOTE: For pre- and post-execution commands that execute on a Windows Server 2003, x64
Edition platform, users must have “Read” and “Execute” privileges for cmd.exe.
Standard input and standard output and error are set to NULL. The output from the
pre- and post-execution commands can be explicitly redirected to a file for
debugging purposes.