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

View of /FortyEightMeta/reset_sims_load.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Sat Jan 3 23:29:10 2009 UTC (11 years, 3 months ago) by redwards
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_dev_10262011, mgrast_dev_02212011, mgrast_release_3_0, mgrast_dev_03252011, 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, myrast_33, mgrast_dev_04052011, mgrast_dev_02222011, HEAD
code to reset lost mg sims loading

#__perl__
#
# There is an occassional error where the sims load fails, but almost everything thinks they are still queued right until mg_load_done at the end
#
# If this dies and says there is an error, you only see it at the end of the run.

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 = "reset_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";


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

my @err_jobs = $status_db->get_tasks_where("status != ?", 'load_complete');

my $update;
foreach my $ej (@err_jobs)
{
	my($sjob, $task, $rec)=@$ej;
	$rec->{status}='not_started';
	$status_db->set_task($sjob, $task, $rec);
	$update++;
}

print "Updated $update jobs\nPlease run get_sim_status -resubmit $jobdir\n" if ($update);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3