25.06.2015 Views

Administering Platform LSF - SAS

Administering Platform LSF - SAS

Administering Platform LSF - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 32<br />

Interactive Jobs with bsub<br />

Redirecting a script to bsub standard input<br />

You can redirect a script to the standard input of the bsub command:<br />

% bsub < myscript<br />

Job submitted to queue .<br />

In this example, the myscript file contains job submission options as well as<br />

command lines to execute. When the bsub command reads a script from its<br />

standard input, it can be modified right after bsub returns for the next job<br />

submission.<br />

When the script is specified on the bsub command line, the script is not<br />

spooled:<br />

% bsub myscript<br />

Job submitted to default queue .<br />

In this case the command line myscript is spooled, instead of the contents of<br />

the myscript file. Later modifications to the myscript file can affect job<br />

behavior.<br />

Specifying embedded submission options<br />

You can specify job submission options in scripts read from standard input by<br />

the bsub command using lines starting with #BSUB:<br />

% bsub -q simulation<br />

bsub> #BSUB -q test<br />

bsub> #BSUB -o outfile -R "mem>10"<br />

bsub> myjob arg1 arg2<br />

bsub> #BSUB -J simjob<br />

bsub> ^D<br />

Job submitted to queue .<br />

There are a few things to note:<br />

◆ Command-line options override embedded options. In this example, the<br />

job is submitted to the simulation queue rather than the test queue.<br />

◆ Submission options can be specified anywhere in the standard input. In the<br />

above example, the -J option of bsub is specified after the command to<br />

be run.<br />

◆ More than one option can be specified on one line, as shown in the<br />

example above.<br />

<strong>Administering</strong> <strong>Platform</strong> <strong>LSF</strong> 411

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!