NAME

LSF::Job - create and manipulate LSF jobs

SYNOPSIS

use LSF::Job;

use LSF::Job PRINT => 1;

$job = LSF::Job->new(123456);

...

$job = LSF::Job->submit(-q => 'default' ,-o => '/dev/null' ,"echo hello");

$job2 = LSF::Job->submit(-q => 'default' ,-o => '/home/logs/output.txt' ,"echo world!");

$job2->modify(-w => "done($job)" );

$job2->del(-n => 1);

...

$job->top();

$job->bottom();

... etc ...

DESCRIPTION

LSF::Job is a wrapper arround the LSF b* commands used to submit and manipulate jobs. for a description of how the LSF commands work see the man pages of:

bsub bswitch bdel bkill bstop bmod btop bbot

CONSTRUCTOR

new ( [NUM] )

$job = LSF::Job->new(123456);

Creates a new LSF::Job object.

Required argument is a LSF jobid. This does not *have* to exist in the system but would probably be a good idea!

submit ( [ [ARGS] ], [COMMAND_STRING] )

$job = LSF::Job->submit(-q => 'default' ,-o => '/dev/null' ,"echo hello");

Creates a new LSF::Job object.

Arguments are the LSF parameters normally passed to 'bsub'.

Required parameter is the command line (as a string) that you want to execute.

CLASS METHODS

LSF::Job->print( [ [ TRUE or FALSE ] ] )

Controls whether or not the LSF command line output is printed. The default is OFF. When called with no arguments returns the current print status.

METHODS

$job->id

id returns the jobid of the LSF Job. The object used in string context also gives the same result leading to some interesting possibilities when building up job interdependencies

$job->switch( [ARGS] )

Switches the LSF job between LSF queues. See the bswitch man page. Returns 1 on success, 0 on failure. Sets $? and $@;

$job->delete( [ARGS] )

Deletes the LSF job from the system. See the bdel man page. Returns 1 on success, 0 on failure. Sets $? and $@;

$job->kill

Kills the LSF job. See the bkill man page. Returns 1 on success, 0 on failure. Sets $? and $@;

$job->stop

Stops the LSF job. See the bstop man page. Returns 1 on success, 0 on failure. Sets $? and $@;

$job->modify( [ARGS] )

Modifies the LSF job. See the bmod man page. Since the objects are overloaded to return the job id when used in string context this allows easy build up of job dependancies e.g. Returns 1 on success, 0 on failure. Sets $? and $@;

$job3->modify(-w => "done($job1) && done($job2)" );

$job->top

Moves the LSF job to the top of its queue. See the btop man page. Returns 1 on success, 0 on failure. Sets $? and $@;

$job->bottom

Moves the LSF job to the bottom of its queue. See the bbot man page. Returns 1 on success, 0 on failure. Sets $? and $@;

$job->info

Returns a LSF::JobInfo object with information about the LSF job. See the LSF::JobInfo perldoc page.

SEE ALSO

LSF, LSF::JobInfo, bsub, bswitch, bdel, bkill, bstop, bmod, btop, bbot

BUGS

Please report them.

HISTORY

The LSF::Batch module on cpan didn't compile easily on all platforms i wanted. The LSF API didn't seem very perlish either. As a quick fix I knocked these modules together which wrap the LSF command line interface. It was enough for my simple usage. Hopefully they work in a much more perly manner.

AUTHOR

Mark Southern (mark_southern@merck.com)

COPYRIGHT

Copyright (c) 2002, Merck & Co. Inc. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)