Configuration to enable job switch controls

Enable job switch controls with at least one eswitch executable file in the directory specified by the parameter LSF_SERVERDIR in the lsf.conf file.

LSF does not include a default eswitch; write your own programs to meet the job requirements of your site.


Executable file UNIX naming convention Windows naming convention
eswitch LSF_SERVERDIR/eswitch.application LSF_SERVERDIR\eswitch.application.exe

LSF_SERVERDIR\eswitch.application.bat


The name of your eswitch indicates the application with which it runs. For example: eswitch.fluent.

Restriction: The name eswitch.user is reserved. Do not use the name eswitch.user for an application-specific eswitch.

Valid file names contain only alphanumeric characters, underscores (_), and hyphens (-).

Once the LSF_SERVERDIR contains one or more eswitch executable files, users can specify the eswitch programs that are associated with each job that they switch.

Environment variables used by eswitch

When you write an eswitch, you can use the following environment variables provided by LSF for the eswitch execution environment:

LSB_SWITCH_PARM_FILE
Points to a temporary file that LSF uses to store the bswitch options entered in the command line. An eswitch reads this file at the job bswitch level and either accepts or changes the values.

An eswitch can change the target queue name by writing to the file that is specified by the LSB_SWITCH_MODIFY_FILE environment variable.

The temporary file pointed to by LSB_SWITCH_PARM_FILE stores the following information:
Option bswitch option Description
LSB_SWITCH   If set to Y, indicates that this is a bswitch request.
LSB_SWITCH_ADDITIONAL -a The name of the eswitch script.
LSB_SWITCH_JOB bswitch job ID command argument The ID of the job, job array, or job array elements.
LSB_SWITCH_QUEUE bswitch queue name command argument The name of the target queue.

LSB_SWITCH_MODIFY_FILE
Points to the file that the eswitch uses to modify the bswitch target queue values.

When your eswitch runs, LSF checks the LSB_SWITCH_MODIFY_FILE and applies changes so that the job switches to the revised queue.

LSB_SWITCH_ABORT_VALUE
Indicates to LSF that a job switch request should be rejected. For example, if you want LSF to reject a job switch request, your eswitch must contain the line
exit $LSB_SWITCH_ABORT_VALUE