LSF Version 7.3 - Administering Platform LSF

Administering Platform LSF 561
Pre-Execution and Post-Execution Commands
Post-execution commands
If a post-execution command is specified, then the command is run after the job is
finished regardless of the exit state of the job.
Post-execution commands are typically used to clean up some state left by the
pre-execution and the job execution. LSF supports job-level, queue-level, and
application-level (
lsb.applications) post-execution.
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.
The
bsub -Ep option specifies job-level post-execution commands to run on the
execution host after the job finishes.
Queue-level and application-level commands
In some situations (for example, license checking), it is better to specify a
queue-level or application-level pre-execution command instead of requiring every
job be submitted with the
-E option of bsub.
Queue-level pre-execution commands run before application-level pre-execution
commands. Job level pre-execution commands (
bsub -E) override
application-level pre-execution commands.
Application level pre-execution commands run on the execution host before the job
associated with the application profile is dispatched on an execution host.
When a job finishes, the application-level post-execution commands run, followed
by queue-level post-execution commands if any.
Application-level post-execution commands run on the execution host after the job
associated with the application profile has finished running on the execution host.
They also run if the PRE_EXEC command exits with a 0 exit status, but the job
execution environment failed to be set up.
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.
By default, 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.