Platform LSF Administration Guide Version 6.2
Chapter 31
Pre-Execution and Post-Execution Commands
Administering Platform LSF
481
Job-level commands
The bsub -E option specifies an arbitrary command to run before starting the batch
job. When LSF finds a suitable host on which to run a job, the pre-execution command
is executed on that host. If the pre-execution command runs successfully, the batch job
is started.
Job-level post-execution commands are not supported.
Queue-level commands
In some situations (for example, license checking), it is better to specify a queue-level
pre-execution command instead of requiring every job be submitted with the
-E option
of
bsub.
Queue-level commands run on the execution host before or after a job from the queue
is run.
The LSF administrator uses the PRE_EXEC and POST_EXEC parameters in
lsb.queues to set up queue-level pre- and post-execution commands.
Post-execution job states
Some jobs may not be considered complete until some post-job processing is
performed. For example, a job may need to exit from a post-execution job script, clean
up job files, or transfer job output after the job completes.
The DONE or EXIT job states do not indicate whether post-processing is complete, so
jobs that depend on processing may start prematurely. Use the
post_done and
post_err keywords on the bsub -w command to specify job dependency conditions
for job post-processing. The corresponding job states POST_DONE and POST_ERR
indicate the state of the post-processing.
The
bhist command displays the POST_DONE and POST_ERR states. The
resource usage of post-processing is not included in the job resource usage.
After the job completes, you cannot perform any job control on the post-processing.
Post-processing exit codes are not reported to LSF. The post-processing of a repetitive
job cannot be longer than the repetition period.