NAME
LSF::JobManager - submit and wait for a set of LSF Jobs
SYNOPSIS
use LSF PRINT => 1;
use LSF::JobManager;
my $m = LSF::JobManager->new(-q=>'small');
my $job = $m->submit("echo hello");
$m->submit("echo world");
for my $job ($m->jobs){
$job->top;
}
$m->wait_all_children;
print "All children have completed!\n";
for ($m->jobs_with_status('EXIT') ){
print "Job with id $_ exited non zero\n";
}
DESCRIPTION
LSF::JobManager
provides a simple mechanism to submit a set of command lines to the LSF Batch system and then wait for them all to finish in a blocking (efficient) manner. Additionally, the LSF Batch system can be polled for jobs of particular status and those jobs are returned as LSF::Job objects; This is an inefficient way to wait for all jobs to complete but can be used to determine which jobs have a particular status.
CONSTRUCTOR
- new ( [ ARGS ] )
-
$manager = LSF::JobManager->new(-q=>'small' ,-m=>'mymachine');
Creates a new
LSF::JobManager
object.Any parameters are used as defaults passed to the submit method.
METHODS
- $manager->submit( [ [ ARGS ] ], [CMD] )
-
Submits a command line to LSF. This is a wrapper around the LSF::Job->submit call. The required argument is the command line to submit. Optional arguments override the defaults given to
new
. The submitted LSF::Job object is returned on success, otherwise undef is returned, $? and $@ set. SeeLSF::Job
- $manager->wait_all_children()
-
Waits for all previously submitted LSF Jobs to complete in a blocking manner
- $manager->jobs_with_status( [ [ STATUS_FLAGS ] ] )
-
Returns an array of jobs matching the given status flags (see LSF documentation) The default flag is 'EXIT', returning an array of LSF::Job objects representing command lines that exited non zero.
- $manager->params()
-
Returns an array of the parameters that were passed to new
- $manager->jobs()
-
Returns an array of the submitted LSF::Job objects.
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)
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 205:
You forgot a '=back' before '=head1'