Commit 12ef1ec6 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Defer the creation of the funnel job

parent 8071c155
...@@ -391,16 +391,11 @@ sub dataflow { ...@@ -391,16 +391,11 @@ sub dataflow {
die "Asked to dataflow into $funnel_job_count funnel jobs instead of 1"; die "Asked to dataflow into $funnel_job_count funnel jobs instead of 1";
} else { } else {
my $funnel_job = Bio::EnsEMBL::Hive::AnalysisJob->new(
@$common_params,
'input_id' => $output_ids_for_this_rule->[0],
'status' => 'SEMAPHORED',
);
# NB: $job_adaptor happens to belong to the $funnel_job, but not necesarily to $fan_jobs or $emitting_job # NB: $job_adaptor happens to belong to the $funnel_job, but not necesarily to $fan_jobs or $emitting_job
my ($semaphore_id, $funnel_job_id, @fan_job_ids) = $job_adaptor->store_a_semaphored_group_of_jobs( $funnel_job, $fan_jobs, $emitting_job ); my ($semaphore_id, @fan_job_ids) = $job_adaptor->store_a_semaphored_group_of_jobs( $output_ids_for_this_rule->[0], $fan_jobs, $emitting_job );
push @output_job_ids, $funnel_job_id, @fan_job_ids; push @output_job_ids, @fan_job_ids;
} }
} else { # non-semaphored dataflow (but potentially propagating any existing semaphores) } else { # non-semaphored dataflow (but potentially propagating any existing semaphores)
my @non_semaphored_jobs = map { Bio::EnsEMBL::Hive::AnalysisJob->new( my @non_semaphored_jobs = map { Bio::EnsEMBL::Hive::AnalysisJob->new(
......
...@@ -238,7 +238,7 @@ sub store_jobs_and_adjust_counters { ...@@ -238,7 +238,7 @@ sub store_jobs_and_adjust_counters {
=cut =cut
sub store_a_semaphored_group_of_jobs { sub store_a_semaphored_group_of_jobs {
my ($self, $funnel_job, $fan_jobs, $emitting_job, $no_leeching) = @_; my ($self, $funnel_input_id, $fan_jobs, $emitting_job, $no_leeching, $dependent_dataflow_rule) = @_;
my $emitting_job_id; my $emitting_job_id;
...@@ -317,7 +317,7 @@ sub store_a_semaphored_group_of_jobs { ...@@ -317,7 +317,7 @@ sub store_a_semaphored_group_of_jobs {
my (@fan_job_ids) = @{ $self->store_jobs_and_adjust_counters( $fan_jobs, 1, $emitting_job_id) }; my (@fan_job_ids) = @{ $self->store_jobs_and_adjust_counters( $fan_jobs, 1, $emitting_job_id) };
return ($funnel_semaphore->dbID, $funnel_job_id, @fan_job_ids); return ($funnel_semaphore->dbID, @fan_job_ids);
} }
......
...@@ -135,8 +135,7 @@ sub main { ...@@ -135,8 +135,7 @@ sub main {
my ($semaphore_id, $job_id); my ($semaphore_id, $job_id);
if( $wrap_in_semaphore ) { if( $wrap_in_semaphore ) {
my $dummy; ($semaphore_id, $job_id) = $job_adaptor->store_a_semaphored_group_of_jobs( undef, [ $job ], undef );
($semaphore_id, $dummy, $job_id) = $job_adaptor->store_a_semaphored_group_of_jobs( undef, [ $job ], undef );
} else { } else {
($job_id) = @{ $job_adaptor->store_jobs_and_adjust_counters( [ $job ] ) }; ($job_id) = @{ $job_adaptor->store_jobs_and_adjust_counters( [ $job ] ) };
} }
......
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