[Bio] / FortyEightMeta / mg_load_done.pl Repository:
ViewVC logotype

Annotation of /FortyEightMeta/mg_load_done.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.1
2 :     #
3 :     # mg_load_done is invoked by sge at the end of the sims processing when the final
4 :     # mg_load_sims jobs have completed. Do any cleanup / sanity checking required.
5 :     #
6 :    
7 :     use strict;
8 :     use FIG;
9 :     use FIG_Config;
10 :     use File::Basename;
11 :     use Data::Dumper;
12 :     use GenomeMeta;
13 :     use Job48;
14 :     use JobStage;
15 :     use SGE;
16 :     use FortyEightMeta::SimDB;
17 :     use FortyEightMeta::SimStatusDB;
18 :    
19 :     #
20 :     # We're the completion script for the check_sims stage.
21 :     #
22 :     my $STAGE = "check_sims";
23 :    
24 :     @ARGV == 1 or die "Usage: $0 job-dir\n";
25 :    
26 :     my $jobdir = shift;
27 :    
28 :     -d $jobdir or die "$0: job dir $jobdir does not exist\n";
29 :    
30 :     my $stage = new JobStage('Job48', $STAGE, $jobdir);
31 :     $stage or die "Cannot create job for $jobdir\n";
32 :    
33 :     my $job_id = basename($jobdir);
34 :     my $job = $stage->job();
35 :    
36 :     my $meta = $job->meta;
37 :    
38 :     print "Running job! $jobdir \n";
39 :    
40 :     print "MG load is done\n";
41 :    
42 : olson 1.3 #
43 :     # Need to check status of the sims. If there are any errors, fail the
44 :     # pipeline stage.
45 :     #
46 :    
47 :     my $status_db = FortyEightMeta::SimStatusDB->new($job_id);
48 :    
49 :     my @err_jobs = $status_db->get_tasks_where("status != ?", 'load_complete');
50 :     if (@err_jobs)
51 :     {
52 :     print "The following jobs had errors\n";
53 :     print Dumper(\@err_jobs);
54 :     $stage->fatal("Errors detected during sims runs");
55 :     }
56 :    
57 : olson 1.2 $stage->run_process('create_indexes', "$FIG_Config::bin/mg_create_db_indexes", $jobdir);
58 :    
59 : olson 1.1 $stage->set_status("complete");
60 :     $stage->set_running("no");
61 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3