Command-level job starters

A command-level job starter allows you to specify an executable file that does any necessary setup for the job and runs the job when the setup is complete. You can select an existing command to be a job starter, or you can create a script containing a desired set of commands to serve as a job starter.

This section describes how to set up and use a command-level job starter to run interactive jobs.

Command-level job starters have no effect on batch jobs, including interactive batch jobs.

A job starter can also be defined at the queue level using the JOB_STARTER parameter. Only the LSF administrator can configure queue-level job starters.

LSF_JOB_STARTER environment variable

Use the LSF_JOB_STARTER environment variable to specify a command or script that is the job starter for the interactive job. When the environment variable LSF_JOB_STARTER is defined, RES invokes the job starter rather than running the job itself, and passes the job to the job starter as a command-line argument.

Using command-level job starters

  • UNIX: The job starter is invoked from within a Bourne shell, making the command-line equivalent:
    /bin/sh -c "$LSF_JOB_STARTER command [argument ...]"
    

    where command and argument are the command-line arguments you specify in lsrun, lsgrun, or ch.

  • Windows: RES runs the job starter, passing it your commands as arguments:
    LSF_JOB_STARTER command [argument ...]
    

Examples

UNIX

If you define the LSF_JOB_STARTER environment variable using the following C-shell command:

% setenv LSF_JOB_STARTER "/bin/sh -c"

Then you run a simple C-shell job:

% lsrun "'a.out; hostname'"

The command that actually runs is

/bin/sh -c "/bin/sh -c 'a.out; hostname'"

The job starter can be a shell script. In the following example, the LSF_JOB_STARTER environment variable is set to the Bourne shell script named job_starter:

$ LSF_JOB_STARTER=/usr/local/job_starter

The job_starter script contains the following:
#!/bin/sh
set term = xterm eval "$*"

Windows

If you define the LSF_JOB_STARTER environment variable as follows:

set LSF_JOB_STARTER=C:\cmd.exe /C

Then you run a simple DOS shell job:

C:\> lsrun dir /p

The command that actually runs is:

C:\cmd.exe /C dir /p