lsrun

Runs an interactive task through LSF.

Synopsis

lsrun [-l] [-L] [-P] [-S] [-v] [-m "host_name ..." | -m "cluster_name ..."] [-R "res_req"] command [argument ...]
lsrun [-h | -V]

Description

With the LSF multicluster capability job forwarding model, the default is to run the task on a host in the local cluster.

By default, the lsrun command first tries to get resource requirement information from the remote task list to find an eligible host. Otherwise, the lsrun command runs the task on a host that is of the same host type (or architecture) as the submission host. If several hosts of the same architecture are available, the host with the lowest CPU and memory load is selected.

By default, if execution fails and the local host satisfies resource requirements, LSF runs the task locally.

By default, the lsrun command does not create a pseudo-terminal when it runs the task.

If the LSF_UGROUP_TRANSFER parameter is enabled in the lsf.conf file, tasks in the execution side that the lsrun command runs use the UNIX group information that is set by the user on the client side.

Options

-l
If execution on another host fails, runs the task locally.
-L
Forces the lsrun command to go through RES to run a task. By default, the lsrun command does not use RES if the task is going to run on the current host.

If RES execution fails and the local host satisfies resource requirements, LSF runs the task directly on local host.

-P
Creates a pseudo-terminal when the task is started on UNIX hosts. This option is necessary to run programs that require a pseudo-terminal (for example, the vi editor).

This option is not supported on Windows.

-S
Creates a pseudo-terminal with shell mode support when the task is started on a UNIX host. Shell mode support is required for running interactive shells or applications that redefine the CTRL-C and CTRL-Z keys (for example, jove).

This option is not supported on Windows.

-v
Displays the name of the host that runs the task.
-m "host_name ..." | -m "cluster_name ..."
The execution host must be one of the specified hosts. If a single host is specified, all resource requirements are ignored.

With the LSF multicluster capability job forwarding model, the execution host can be a host in one of the specified clusters, if the remote cluster accepts tasks from the local cluster. Remote clusters are defined in the RemoteClusters section in the lsf.cluster file.

-R "res_req"
Runs the task on a host that meets the specified resource requirement. For a complete explanation of resource requirement expressions, see Administering IBM Spectrum LSF. To find out what resources are configured in your system, use the lsinfo and lshosts commands.

LSF supports ordering of resource requirements on all load indices, including external load indices, either static or dynamic.

Exclusive resources need to be explicitly specified within the resource requirement string. For example, you defined a resource that is called bigmem in lsf.shared and defined it as an exclusive resource for hostE in lsf.cluster.mycluster. Use the following command to submit a task to run on hostE:

lsrun -R "bigmem" myjob
Or
lsrun -R "defined(bigmem)" myjob

If the -m option is specified with a single host name, the -R option is ignored.

-h
Prints command usage to stderr and exits.
-V
Prints LSF release version to stderr and exits.

Usage

You can use the lsrun command together with other utility commands such as lsplace, lsload, and lsloadadj to write load sharing applications in the form of UNIX shell scripts.

The lsrun command supports interactive job control. Suspending the lsrun command suspends both the task and the lsrun command. Continuing the lsrun command also continues the task.

If the LSB_DISABLE_LIMLOCK_EXCL=y parameter is configured (to enable preemption of exclusive jobs, for example), you can use the lsrun command to start a task on a host that is running an exclusive job.

You can simulate the -n option of rsh by redirecting input from /dev/null. For example,
lsrun cat </dev/null &

Diagnostics

If a problem is detected in LSF, the lsrun command exits with status -10 and prints an error message to stderr. The task does not run.

If a system call fails or incorrect arguments are specified, the exit status is -1 and an error message is printed to stderr.

Otherwise, the exit status is the exit status of the task.

See also

lshosts, lsload, lsplace, ls_rexecv, rsh, lsf.cluster