Platform LSF Administrator's Primer Version 6.2

Running LSF Jobs
Platform LSF Administrator’s Primer
28
Running interactive tasks (lsrun and lsgrun)
lsrun
The lsrun command runs a task on either the current local host or remotely on the
best available host, provided it can find the necessary resources and the appropriate host
type.
For example, the following command runs the UNIX
ls command. In this case, the
command ran through LSF on the local host:
% lsrun ls -l /usr/share/lsf/lsf_62/conf/
total 742
-rw-r--r-- 1 root lsf 11372 Jul 16 16:23 cshrc.lsf
-rw-r--r-- 1 root lsf 365 Oct 25 10:55 hosts
lrwxrwxrwx 1 root lsf 49 Jul 16 15:53 license.dat
drwxr-xr-x 3 lsfadmin lsf 512 Jul 16 15:53 lsbatch
-rw-r--r-- 1 lsfadmin lsf 1776 Nov 23 15:13 lsf.conf
-rw-r--r-- 1 lsfadmin lsf 8453 Nov 16 17:46 lsf.shared
-rw-r--r-- 1 lsfadmin lsf 578 Jul 16 15:53 lsf.task
-rw-r--r-- 1 root lsf 10485 Jul 16 17:08 profile.lsf
You can also specify a host where you want to run a command. For example, the
following command runs the UNIX
hostname command on the remote host hosta:
% lsrun -v -m hosta hostname
<<Execute hostname on remote host hosta>>
hosta
lsgrun
The lsgrun command is similar to lsrun, but it runs a task on a group of hosts.
For example, the following command runs the UNIX
hostname command on three
remote hosts:
% lsgrun -v -m "hosta hostb hostc" hostname
<<Executing hostname on hosta>>
hosta
<<Executing hostname on hostb>>
hostb
<<Executing hostname on hostc>>
hostc
Integrating your applications with LSF
By integrating your applications with LSF, you can assure your users correct and
complete job submission and execution without requiring them to learn LSF commands.
There are three basic ways to integrate applications with LSF:
Wrapper shell scripts
Wrapper binary executables
Modifying existing application source code and interfaces
Wrapper shell
scripts
The easiest integration method is to put the bsub command into an executable file like
a shell script. A wrapper script is an executable file for launching your application
through LSF. It gives users a simple interface to run their jobs that is easy to deploy and
maintain.
For example, if your application is called
abc, rename abc to abc_real and create a
wrapper script called
abc, like this: