LSF Version 7.3 - Platform LSF Configuration Reference

If the pre-execution or post-execution command is not in your
usual execution path, you must specify the full path name of the
command.
Order of command execution
Pre-execution commands run in the following order:
1.
The queue-level command
2.
The application-level or job-level command. If you specify a command at both the
application and job levels, the job-level command overrides the application-level
command; the application-level command is ignored.
If a pre-execution command is specified at the … Then the commands execute in the order of …
Queue, application, and job levels
1.
Queue level
2.
Job level
Queue and application levels
1.
Queue level
2.
Application level
Queue and job levels
1.
Queue level
2.
Job level
Application and job levels
1.
Job level
Post-execution commands run in the following order:
1.
The application-level command
2.
The queue-level command
Users cannot specify a post-execution command at the job level.
Pre-execution command behavior
A pre-execution command returns information to LSF by means of the exit status. LSF holds
the job in the queue until the specified pre-execution command returns an exit code of zero
(0). If the pre-execution command exits with a non-zero value, the job pends until LSF tries
again to dispatch it. While the job remains in the PEND state, LSF dispatches other jobs to the
execution host.
If the pre-execution command exits with a value of 99, the job exits without pending. This
allows you to cancel the job if the pre-execution command fails.
You must ensure that the pre-execution command runs without side effects; that is, you should
define a pre-execution command that does not interfere with the job itself. For example, if you
use the pre-execution command to reserve a resource, you cannot also reserve the same
resource as part of the job submission.
LSF users can specify a pre-execution command at job submission. LSF first finds a suitable
host on which to run the job and then runs the pre-execution command on that host. If the
pre-execution command runs successfully and returns an exit code of zero, LSF runs the job.
Feature: Pre-execution and post-execution processing
40 Platform LSF Configuration Reference