-
Notifications
You must be signed in to change notification settings - Fork 0
/
maker_wq_worker
executable file
·106 lines (90 loc) · 2.44 KB
/
maker_wq_worker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env perl
use strict "vars";
use strict "refs";
use warnings;
use FindBin;
use vars qw($RANK $LOG $CMD_ARGS);
BEGIN{
if (not ($ENV{CGL_SO_SOURCE})) {
$ENV{CGL_SO_SOURCE} = "$FindBin::Bin/../lib/CGL/so.obo";
}
if (not ($ENV{CGL_GO_SOURCE})) {
$ENV{CGL_GO_SOURCE} = "$FindBin::Bin/../lib/CGL/gene_ontology.obo"
}
$CMD_ARGS = join(' ', @ARGV);
#what to do on ^C
$SIG{'INT'} = sub {
print STDERR "\n\nMaker aborted by user!!\n\n" unless($main::qq);
exit (1);
};
#supress warnings from storable module
$SIG{'__WARN__'} = sub {
warn $_[0] if ( $_[0] !~ /Not a CODE reference/ &&
$_[0] !~ /Can\'t store item / &&
$_[0] !~ /Find\:\:skip_pattern|File\/Find\.pm/
);
};
#output to log file of seq that caused rank to die
$SIG{'__DIE__'} =
sub {
if (defined ($LOG) && defined $_[0]) {
my $die_count = $LOG->get_die_count();
$die_count++;
$LOG->add_entry("DIED","RANK",$RANK);
$LOG->add_entry("DIED","COUNT",$die_count);
}
die $_[0]."\n".
"FATAL ERROR\n";
};
}
my $link_output = `find -name "*" -exec ln -s {} . \\\;`;
my $numArgs = $#ARGV + 1;
if ($numArgs < 1) {
print "Usage: maker_wq_worker counter\n";
exit;
}
my $counter = $ARGV[0];
my $tier;
use lib "./lib";
use Storable qw(retrieve);
use ds_utility;
use runlog;
use Error qw(:try);
use Error::Simple;
use Process::MpiTiers;
use Proc::Signal;
#use Fasta;
#use maker::auto_annotator;
#use FastaChunker;
#use cluster;
#use repeat_mask_seq;
#use GFFDB;
#use Process::MpiChunk;
#use GI;
#use Cwd;
#use FileHandle;
#use File::Path;
#use Getopt::Long qw(:config no_ignore_case);
#use Dumper::GFF::GFFV3;
#use Iterator::Any;
#use Iterator::Fasta;
#use Iterator::GFF3;
my @ts = @ARGV;
foreach my $c (@ts) {
my $inFile = $c."_todo.tier";
my $total = scalar(@ts);
print "On component $c of $#ts, $total, $counter\n";
#tier files were generated with the nstore command from the Storable Perl module
#This simply stores a hash to disk in a convenient format.
$tier = ${retrieve($inFile)};
$tier->CTL_OPT->{out_name} = ".";
$tier->CTL_OPT->{out_base} = ".";
$tier->CTL_OPT->{the_void} = ".";
$tier->{the_void} = ".";
#use Process::MpiTiers;
print time." :: Worker $counter :: starting \n";
$tier->run_all;
print time." :: Worker $counter :: finished \n";
if($tier->failed) { print "EXIT:-1 \n"; last; }
elsif($tier->terminated) { print "EXIT:1 \n"; next; }
}