Commit 30c16952 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Pulling in the recent bug-fixes

- always write the sequence to the current seqio - fix for creating lots of empty output files
- fix warning "Use of uninitialized value in subroutine entry"
- bugfix: jobs could not trigger MEMLIMIT events
- bugfix: release the unfinished batch if the worker is contaminated
parents 16fdd35a d6e67f01
......@@ -300,6 +300,7 @@ sub register_worker_death {
}
if( $current_role and !$current_role->when_finished() ) {
$current_role->worker($worker); # So that release_undone_jobs_from_role() has the correct cause_of_death and work_done
$current_role->when_finished( $worker_died );
$self->db->get_RoleAdaptor->finalize_role( $current_role, $self_burial );
}
......
......@@ -128,14 +128,14 @@ sub write_output {
my $chunk_size = 0; # number of sequences in the current chunk
my $chunk_name = $output_prefix.$chunk_number.$output_suffix;
my $chunk_seqio = Bio::SeqIO->new(-file => '>'.$chunk_name, -format => 'fasta');
while (my $seq_object = $input_seqio->next_seq) {
$chunk_seqio->write_seq( $seq_object );
if((my $seq_length = $seq_object->length()) + $chunk_length <= $max_chunk_length) {
# add to the current chunk:
$chunk_seqio->write_seq( $seq_object );
$chunk_length += $seq_length;
$chunk_size += 1;
} else {
# dataflow the current chunk:
......@@ -163,6 +163,8 @@ sub write_output {
'chunk_length' => $chunk_length,
'chunk_size' => $chunk_size
}, 2);
} else {
unlink $chunk_name unless (stat($chunk_name))[7];
}
}
......
=pod
=head1 NAME
......@@ -84,7 +85,7 @@ sub stringify {
local $Data::Dumper::Quotekeys = 1; # conserve some space
local $Data::Dumper::Useqq = 1; # escape the \n and \t correctly
local $Data::Dumper::Pair = ' => '; # make sure we always produce Perl-parsable structures, no matter what is set externally
local $Data::Dumper::Maxdepth = undef; # make sure nobody can mess up stringification by setting a lower Maxdepth
local $Data::Dumper::Maxdepth = 0; # make sure nobody can mess up stringification by setting a lower Maxdepth
return Dumper($structure);
}
......
......@@ -554,7 +554,9 @@ sub run {
}
}
$self->adaptor->register_worker_death($self, 1);
# The second arguments ("self_burial") controls whether we need to
# release the current (unfinished) batch
$self->adaptor->register_worker_death($self, ($self->cause_of_death eq 'CONTAMINATED' ? 0 : 1));
if($self->debug) {
$self->worker_say( 'AnalysisStats : '.$self->current_role->analysis->stats->toString ) if( $self->current_role );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment