diff --git a/PerlLib/Thread_helper.pm b/PerlLib/Thread_helper.pm index 72e4636..bb43dcb 100644 --- a/PerlLib/Thread_helper.pm +++ b/PerlLib/Thread_helper.pm @@ -202,7 +202,10 @@ sub wait_for_all_threads_to_complete { $self->_add_error_thread($thread); $status = "ERROR"; } - $self->report_thread_info($thread_id, $status); + $self->{thread_id_timing}->{end}->{$thread_id} = time(); + if ($THREAD_MONITORING) { + $self->report_thread_info($thread_id, $status); + } } @{$self->{current_threads}} = (); # clear them out. diff --git a/scripts/cDNA_annotation_comparer.dbi b/scripts/cDNA_annotation_comparer.dbi index b9fab20..bfdaf24 100755 --- a/scripts/cDNA_annotation_comparer.dbi +++ b/scripts/cDNA_annotation_comparer.dbi @@ -34,6 +34,9 @@ use vars qw ($opt_h $opt_p $DEBUG $opt_M $opt_G $MIN_PERCENT_OVERLAP $MIN_PERCEN $STOMP_HIGH_PERCENTAGE_OVERLAPPING_GENE $MIN_PERCENT_ALIGN_LENGTH $MIN_PERCENT_LENGTH_FL_COMPARE $TRUST_FL_STATUS $CLUSTER_ID_ONLY); + +my $RESTRICT_SINGLE_CONTIG = undef; + my $CPU = 2; &GetOptions ('M=s' => \$opt_M, @@ -62,6 +65,8 @@ my $CPU = 2; ## hidden opts for debugging purposes 'CLUSTER_ID_ONLY=i' => \$CLUSTER_ID_ONLY, # the only cluster ID to process. + 'RESTRICT_SINGLE_CONTIG=s' => \$RESTRICT_SINGLE_CONTIG, + ); @@ -140,6 +145,12 @@ _EOH_ ; +### Hidden options +### +## --RESTRICT_SINGLE_CONTIG genomic contig to restrict analysis to +### + + if ($opt_h) {die $usage;} @@ -291,7 +302,9 @@ main: { print "### There are $num_contigs genomic contigs which will be examined.\n"; foreach my $result (@results) { my $asmbl_id = $result->[0]; - + + if ($RESTRICT_SINGLE_CONTIG && $asmbl_id ne $RESTRICT_SINGLE_CONTIG) { next; } + $thread_helper->wait_for_open_thread(); my $thread = threads->create('process_contig', $asmbl_id); @@ -308,7 +321,17 @@ main: { if (@failures) { ## examine them... these are the same threads created above, use use the threads api to access info about them ## such as error messages - die "Error, there were " . scalar(@failures) . " threads (contig jobs) that failed... See error messages above in order to troubleshoot further"; + + print STDERR "Error, there were " . scalar(@failures) . " threads (contig jobs) that failed... See error messages above in order to troubleshoot further"; + + foreach my $failed_thread (@failures) { + my $thread_id = $failed_thread->tid; + print STDERR "Failed thread ($thread_id) info:\n"; + $thread_helper->report_thread_info($thread_id, "FAILED"); + } + + exit(1); + } else { ## all good! diff --git a/scripts/create_mysql_cdnaassembly_db.dbi b/scripts/create_mysql_cdnaassembly_db.dbi index 018b3cc..2b3435b 100755 --- a/scripts/create_mysql_cdnaassembly_db.dbi +++ b/scripts/create_mysql_cdnaassembly_db.dbi @@ -14,7 +14,7 @@ use ConfigFileReader; use vars qw ($opt_c $opt_p $opt_d $opt_h $opt_S $opt_r); -&getopts ('c:p:S:r'); +&getopts ('c:p:S:rd'); $|=1; @@ -88,6 +88,7 @@ if (index($mysql_server, "mysql_socket") != -1) { ## Populate the database structure and static data. my $cmd = "$mysql_exec $mysql_options -D$mysql_db -e 'source $schemafile'"; +print STDERR "CMD: $cmd\n" if $DEBUG; my $result = system ($cmd); die "CMD: $cmd failed.\n" if $result;