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.

About Pre-Execution and Post-Execution Commands<br />

About Pre-Execution and Post-Execution Commands<br />

Pre-execution commands<br />

Post-execution commands<br />

Each batch job can be submitted with optional pre- and post-execution<br />

commands. Pre- and post-execution commands can be any excutable<br />

command lines to be run before a job is started or after a job finishes.<br />

Some batch jobs require resources that <strong>LSF</strong> does not directly support. For<br />

example, appropriate pre- and/or post-execution commands can be used to<br />

handle various situations:<br />

◆ Reserving devices like tape drives<br />

◆ Creating and deleting scratch directories for a job<br />

◆ Customized scheduling<br />

◆ Checking availability of software licenses<br />

◆ Assigning jobs to run on specific processors on SMP machines<br />

By default, the pre- and post-execution commands are run under the same user<br />

ID, environment, and home and working directories as the batch job. If the<br />

command is not in your normal execution path, the full path name of the<br />

command must be specified.<br />

For parallel jobs, the command is run on the first selected host.<br />

Pre-execution commands support job starting decisions which cannot be<br />

configured directly in <strong>LSF</strong>. <strong>LSF</strong> supports both job-level and queue-level preexecution.<br />

The pre-execution command returns information to <strong>LSF</strong> using its exit status.<br />

When a pre-execution command is specified, the job is held in the queue until<br />

the specified pre-execution command returns exit status zero (0).<br />

If the pre-execution command exits with non-zero status, the batch job is not<br />

dispatched. The job goes back to the PEND state, and <strong>LSF</strong> tries to dispatch<br />

another job to that host. While the job is pending, other jobs can proceed<br />

ahead of the waiting job. The next time <strong>LSF</strong> tries to dispatch jobs this process<br />

is repeated.<br />

If the pre-execution command exits with a value of 99, the job will not go back<br />

to the PEND state, it will exit. This gives you flexibility to abort the job if the<br />

pre-execution command fails.<br />

<strong>LSF</strong> assumes that the pre-execution command runs without side effects. For<br />

example, if the pre-execution command reserves a software license or other<br />

resource, you must not reserve the same resource more than once for the same<br />

batch job.<br />

If a post-execution command is specified, then the command is run after the<br />

job is finished regardless of the exit state of the job.<br />

Post-execution commands are typically used to clean up some state left by the<br />

pre-execution and the job execution. Post-execution is only supported at the<br />

queue level.<br />

366<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!