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

Annotation of /FortyEightMeta/mg_sims_done.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : olson 1.1
2 :     #
3 :     # Trivial script that is submitted as a postprocessor to the sims runs that marks
4 :     # the sims stage as complete.
5 :     #
6 :    
7 :     use strict;
8 :     use FIG;
9 :     use FIG_Config;
10 :     use File::Basename;
11 :     use GenomeMeta;
12 :     use Job48;
13 :     use SGE;
14 :    
15 :     my $STAGE = "sims";
16 :    
17 :     @ARGV == 1 or die "Usage: $0 job-dir\n";
18 :    
19 :     my $jobdir = shift;
20 :    
21 :     -d $jobdir or die "$0: job dir $jobdir does not exist\n";
22 :    
23 :     my $job_id = basename($jobdir);
24 :     my $job = new Job48($job_id);
25 :    
26 :     my $meta = $job->meta;
27 :    
28 :     print "Running job! $jobdir\n";
29 :    
30 :     $job->meta->set_metadata("status.$STAGE", "complete");
31 :     $job->meta->set_metadata("$STAGE.running", "no");
32 :    
33 :     sub run
34 :     {
35 :     my(@cmd) = @_;
36 :    
37 :     print "Run @cmd\n";
38 :     my $rc = system(@cmd);
39 :     if ($rc != 0)
40 :     {
41 :     &fatal("Failed with rc=$rc: @cmd");
42 :     }
43 :     }
44 :    
45 :     sub fatal
46 :     {
47 :     my($msg) = @_;
48 :    
49 :     $meta->add_log_entry($0, ['fatal error', $msg]);
50 :     $meta->set_metadata("status.$STAGE", "error");
51 :    
52 :     croak "$0: $msg";
53 :     }
54 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3