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

Annotation of /FigKernelScripts/run_peg_job_worker.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (view) (download) (as text)

1 : olson 1.1 #
2 :     # Worker process.
3 :     #
4 :     # Pulls pegs from the table, works on them with the given script, writes results back.
5 :     #
6 :     # usage: run_peg_job_worker tablename
7 :     #
8 :    
9 :     use FIG;
10 :     use strict;
11 : olson 1.2 use Cluster;
12 : olson 1.1
13 :     my($table) = @ARGV;
14 :    
15 :     if ($table eq "")
16 :     {
17 :     die "Usage: $0 tablename\n";
18 :     }
19 :    
20 :     my $fig = new FIG;
21 : olson 1.2 my $jobmgr = new Cluster::DBJobMgr($fig, $table);
22 : olson 1.1
23 :     my $what = 0;
24 :     my $worker = `hostname`;
25 :     chomp($worker);
26 :     $worker .= ":$$";
27 :    
28 :     while (1)
29 :     {
30 : olson 1.2 my $work = $jobmgr->get_work($worker);
31 : olson 1.3
32 :     if (!$work)
33 :     {
34 :     print "Work done\n";
35 :     last;
36 :     }
37 :     my($id, $input) = @$work;
38 :     print "Got work id=$id\n";
39 :     print $input;
40 : olson 1.1 my $output = "finished $work $what\n";
41 :     $what++;
42 : olson 1.2 $jobmgr->work_done($work, $output);
43 : olson 1.1 }
44 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3