lsrun - run a task through LSF (Load Sharing Facility)
lsrun [ -h ] [ -V ] [ -P ] [ -p ] [ -l ] [ -v ] [ -m host_name ... ] [ -R res_req ] task [ argument ... ]
Submit a task to the LSF system for execution, possibly on a remote host. task is a UNIX command or script. You can use lsrun together with other utility commands such as lsplace(1) , lsload(1) , lsloadadj(1) , and lseligible(1) to write load sharing applications in the form of UNIX shell scripts.
lsrun support interactive job control; suspending an lsrun command suspend both the remote job and lsrun, and continuing lsrun continue the remote job.
-h Print command usage to stderr and exit.
-V Print LSF release version to stderr and exit.
-m host_name ...
Specify the candidate hosts for executing the task. If multiple candidate
hosts are specified (which must be enclosed by « or `), the best
one will be selected according to the resource requirements in the -R
option, or from those hosts associated with the task in the system
remote task list (see lsrtasks(1)
). If none of the candidate hosts
satisfies the resource requirements, the task will not be run. If
only one host is specified, then this option overrides the -R option
and the task will be executed on that host. If this option is not
given, all the hosts in the local LSF cluster will be considered as
the candidates.
-l Always execute the task locally if remote execution fails. If you do not specify this option, the default action is to execute locally when remote execution fails only if the local host also satisfies the resource requirements.
-P Create a pseudo-tty when starting a remote task. This is necessary in order to run programs that require a pseudo-tty (e.g., vi). By default, lsrun does not create a pseudo-tty.
-p Do not create a pseudo-tty when starting a remote task. This may be necessary when multiple lsrun are started in the background.
-R res_req
Execute the task on a host that meets the resource requirements
res_req. This resource requirement are used to choose one host from
all candidate hosts. If option -m is not given, the candidate hosts
will be all hosts with the same host type as the local host unless a
«type == value» exists in resource requirement to specify otherwise.
Resource requirement expressions (see lsfintro(1)
). To find out what
resources are configured in your system, use lsinfo(1)
and lshosts(1)
.
The -m and -R options are mutually exclusive. If neither option is
given, lsrun tries to obtain resource requirement information for task
from the remote task list that is maintained by the load sharing
library (see ls_task(3)
). If task is not found from the remote task
list, lsrun assumes the default requirement. This requirement is to
run task on a host that is of the same host type (or architecture) as
the local host.
If lsrun fails to execute the command on the selected host, it will execute the command on the local host only if the local host satisfies the resource requirements and the -m option is not specified. If -R and -m are not specified, the command's resource requirement is obtained from the user's task list and is used to find an eligible host.
-v Verbose mode. The name of the selected host is displayed.
The -n option of rsh(1) can be simulated by redirecting input from /dev/null.
For example,
lsrun cat </dev/null &
lsrun exits with status -10 and prints an error message to stderr if a problem is detected in LSF and the remote command is not executed. The exit status is -1 and an error message is printed to stderr if a system call fails or incorrect arguments are given. Otherwise, the exit status is the exit status of the remote command.
rsh(1) , lsfintro(1) , ls_rexecv(3) , lsplace(1) , lseligible(1) , lsload(1)