bwelch has asked for the wisdom of the Perl Monks concerning the following question:
This submits a job and waits for completion:
use strict; my $jobID = `bsub -q long -o $cl_log -J seqPipe "$jobCmd"`; print "Waiting for analysis work.\n"; while (1){ last if ( -e "$resultsDir/analysis_completed" ); print LOG "."; sleep 15; } print "\nFound completion flag. Analysis jobs are done.\n";
Assuming each analysis job creates its own flag to indicate completion, this will get more complicated when I'm trying to monitor a dozen jobs. Later on, there's the possibliity that some jobs will have their own set of analysis jobs that they need to monitor.
I'm thinking this while statement will end up with a set of tests, one for each job. Still, it seems inefficient to keep testing for all those files until the last one has finished. Any ideas on better ways to grow this system?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Using flag files to monitor cluster jobs
by BrowserUk (Patriarch) on Oct 26, 2005 at 21:15 UTC | |
by benizi (Hermit) on Oct 31, 2005 at 17:03 UTC | |
by BrowserUk (Patriarch) on Oct 31, 2005 at 17:59 UTC | |
Re: Using flag files to monitor cluster jobs
by chromatic (Archbishop) on Oct 26, 2005 at 22:32 UTC | |
Re: Using flag files to monitor cluster jobs
by GrandFather (Saint) on Oct 26, 2005 at 20:58 UTC |