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

View of /FortyEightMeta/mg_load_done.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (as text) (annotate)
Thu Jun 12 21:35:53 2008 UTC (12 years, 1 month ago) by olson
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_rel_2008_0806, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_rel_2008_0923, mgrast_release_3_0, mgrast_dev_03252011, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, mgrast_rel_2008_0625, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, mgrast_rel_2008_0919, mgrast_rel_2008_1110, myrast_33, mgrast_rel_2008_0917, mgrast_dev_04052011, mgrast_dev_02222011, HEAD
Changes since 1.2: +15 -0 lines
Replace the MLDBM/DB_File sim status database with a postgres version.

#
# mg_load_done is invoked by sge at the end of the sims processing when the final
# mg_load_sims jobs  have completed. Do any cleanup / sanity checking required.
#

use strict;
use FIG;
use FIG_Config;
use File::Basename;
use Data::Dumper;
use GenomeMeta;
use Job48;
use JobStage;
use SGE;
use FortyEightMeta::SimDB;
use FortyEightMeta::SimStatusDB;

#
# We're the completion script for the check_sims stage.
#
my $STAGE = "check_sims";

@ARGV == 1 or die "Usage: $0 job-dir\n";

my $jobdir = shift;

-d $jobdir or die "$0: job dir $jobdir does not exist\n";

my $stage = new JobStage('Job48', $STAGE, $jobdir);
$stage or die "Cannot create job for $jobdir\n";

my $job_id = basename($jobdir);
my $job = $stage->job();

my $meta = $job->meta;

print "Running job! $jobdir \n";

print "MG load is done\n";

#
# Need to check status of the sims. If there are any errors, fail the
# pipeline stage.
#

my $status_db = FortyEightMeta::SimStatusDB->new($job_id);

my @err_jobs = $status_db->get_tasks_where("status != ?", 'load_complete');
if (@err_jobs)
{
    print "The following jobs had errors\n";
    print Dumper(\@err_jobs);
    $stage->fatal("Errors detected during sims runs");
}

$stage->run_process('create_indexes', "$FIG_Config::bin/mg_create_db_indexes", $jobdir);

$stage->set_status("complete");
$stage->set_running("no");


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3