[Bio] / FigKernelScripts / run_peg_job_worker.pl Repository:
ViewVC logotype

View of /FigKernelScripts/run_peg_job_worker.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (as text) (annotate)
Mon Feb 14 17:28:40 2005 UTC (15 years, 1 month ago) by olson
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, caBIG-dataload-0, merge-trunktag-bobdev_news-1, merge-bodev_news-3, efrank-preMakefileToStandardMk, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
Changes since 1.2: +9 -0 lines
New jobsched stuff.

#
# Worker process.
#
# Pulls pegs from the table, works on them with the given script, writes results back.
#
# usage: run_peg_job_worker tablename
#

use FIG;
use strict;
use Cluster;

my($table) = @ARGV;

if ($table eq "")
{
    die "Usage: $0 tablename\n";
}

my $fig = new FIG;
my $jobmgr = new Cluster::DBJobMgr($fig, $table);

my $what = 0;
my $worker = `hostname`;
chomp($worker);
$worker .= ":$$";

while (1)
{
    my $work = $jobmgr->get_work($worker);

    if (!$work)
    {
	print "Work done\n";
	last;
    }
    my($id, $input) = @$work;
    print "Got work id=$id\n";
    print $input;
    my $output = "finished $work $what\n";
    $what++;
    $jobmgr->work_done($work, $output);
}


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3