LSF::JobHistory - get historical information about LSF jobs.
use LSF::JobHistory RaiseError => 0, PrintError => 1, PrintOutput => 0;
( $jobhistory ) = LSF::JobHistory->new( [ARGS] );
( $jobhistory ) = LSF::JobHistory->new( $job );
( $jobhistory ) = LSF::JobHistory->new( [JOBID] );
@jobhistory = LSF::JobHistory->new( -J => '/MyJobGroup/*');
( $jobhistory ) = LSF::JobHistory->new($job);
$jobhistory = $job->history;
... etc ...
$exit_status = $jobhistory->exit_status;
$pid = $jobhistory->pid;
$command = $jobhistory->command;
$cwd = $jobhistory->cwd;
LSF::JobHistory is a wrapper arround the LSF 'bhist' command used to obtain historical information about jobs.
See the 'bhist' man page for more information.
This provides a more reliable way to obtain the exit status of an LSF job than from the LSF::JobInfo object because the bhist command can search all of the available LSF logs to find the information.
($jobhistory) = LSF::JobHistory->new( [ARGS] || [JOBID] );
Creates a new
Arguments are the LSF parameters normally passed to 'bhist' or a valid LSF jobid or LSF::Job object. The bhist command is automatically called with the -n 0 and -l flags.
Returns an array of LSF::JobHistory objects. Of course if your argument to new is a single jobid then you will get an array with one item. If you query for a number of jobs with the same name or path then you will get a list. In scalar context returns the number of jobs that match that criteria.
Please report them. Otherwise... the parsing of the LSF output can fail if the job names have non-alphanumeric characters in them. You probably shouldn't do this anyway.
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.
Mark Southern (email@example.com)
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)