25.06.2015 Views

Administering Platform LSF - SAS

Administering Platform LSF - SAS

Administering Platform LSF - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Writing Job Scripts<br />

Writing Job Scripts<br />

You can build a job file one line at a time, or create it from another file, by<br />

running bsub without specifying a job to submit. When you do this, you start<br />

an interactive session in which bsub reads command lines from the standard<br />

input and submits them as a single batch job. You are prompted with bsub><br />

for each line.<br />

You can use the bsub -Zs command to spool a file.<br />

For more details on bsub options, see the bsub(1) man page.<br />

Writing a job file one line at a time<br />

UNIX example<br />

Windows example<br />

% bsub -q simulation<br />

bsub> cd /work/data/myhomedir<br />

bsub> myjob arg1 arg2 ......<br />

bsub> rm myjob.log<br />

bsub> ^D<br />

Job submitted to queue .<br />

In the above example, the 3 command lines run as a Bourne shell (/bin/sh)<br />

script. Only valid Bourne shell command lines are acceptable in this case.<br />

C:\> bsub -q simulation<br />

bsub> cd \\server\data\myhomedir<br />

bsub> myjob arg1 arg2 ......<br />

bsub> del myjob.log<br />

bsub> ^Z<br />

Job submitted to queue .<br />

In the above example, the 3 command lines run as a batch file (.BAT). Note<br />

that only valid Windows batch file command lines are acceptable in this case.<br />

Specifying job options in a file<br />

UNIX<br />

Windows<br />

In this example, options to run the job are specified in the options_file.<br />

% bsub -q simulation < options_file<br />

Job submitted to queue .<br />

On UNIX, the options_file must be a text file that contains Bourne shell<br />

command lines. It cannot be a binary executable file.<br />

On Windows, the options_file must be a text file containing Windows<br />

batch file command lines.<br />

Spooling a job command file<br />

Use bsub -Zs to spool a job command file to the directory specified by the<br />

JOB_SPOOL_DIR parameter in lsb.params, and use the spooled file as the<br />

command file for the job.<br />

Use the bmod -Zsn command to modify or remove the command file after the<br />

job has been submitted. Removing or modifying the original input file does not<br />

affect the submitted job.<br />

410<br />

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

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

Saved successfully!

Ooh no, something went wrong!