LSF Version 7.3 - Platform LSF Configuration Reference
If multiple esubs are specified and one of the esubs exits with a value of
LSB_SUB_ABORT_VALUE, LSF rejects the job without running the remaining
esubs and returns a value of LSB_SUB_ABORT_VALUE.
LSB_INVOKE_CMD
Specifies the name of the LSF command that most recently invoked an external
executable.
Environment variables used by eexec
When you write an eexec, you can use the following environment variables in addition to all
user-environment or application-specific variables.
LS_EXEC_T
Indicates the stage or type of job execution. LSF sets LS_EXEC_T to:
•
START at the beginning of job execution
•
END at job completion
•
CHKPNT at job checkpoint start
LS_JOBPID
Stores the process ID of the LSF process that invoked eexec. If eexec is intended to
monitor job execution, eexec must spawn a child and then have the parent eexec
process exit. The eexec child should periodically test that the job process is still alive
using the LS_JOBPID variable.
Job submission and execution controls behavior
The following examples illustrate how customized esub and eexec executables can control
job submission and execution.
Validating job submission parameters using esub
When a user submits a job using bsub-P, LSF accepts any project name entered by the user
and associates that project name with the job. This example shows an esub that supports
project-based accounting by enforcing the use of valid project names for jobs submitted by
users who are eligible to charge to those projects. If a user submits a job to any project other
than proj1 or proj2, or if the user name is not user1 or user2, LSF rejects the job based on the
exit value of LSB_SUB_ABORT_VALUE.
#!/bin/sh
. $LSB_SUB_PARM_FILE
# Redirect stderr to stdout so echo can be used for error messages exec 1>&2
# Check valid projects
if [ $LSB_SUB_PROJECT_NAME != "proj1" -o $LSB_SUB_PROJECT_NAME != "proj2" ];
then
echo "Incorrect project name specified"
exit $LSB_SUB_ABORT_VALUE
fi
USER=`whoami`
if [ $LSB_SUB_PROJECT_NAME="proj1" ]; then
# Only user1 and user2 can charge to proj1
if [$USER != "user1" -a $USER != "user2" ]; then
echo "You are not allowed to charge to this project"
exit $LSB_SUB_ABORT_VALUE
fi
fi
Feature: External job submission and execution controls
78 Platform LSF Configuration Reference