Commit 3bbf5583 authored by Leo Gordon's avatar Leo Gordon
Browse files

Scheduler should explain that workers are not added because of the pending ones

parent 7261b8b4
...@@ -699,7 +699,7 @@ sub schedule_workers { ...@@ -699,7 +699,7 @@ sub schedule_workers {
my ($self, $filter_analysis, $orig_pending_by_rc_id, $available_submit_limit) = @_; my ($self, $filter_analysis, $orig_pending_by_rc_id, $available_submit_limit) = @_;
my $statsDBA = $self->db->get_AnalysisStatsAdaptor; my $statsDBA = $self->db->get_AnalysisStatsAdaptor;
my $clearly_needed_analyses = $statsDBA->fetch_by_needed_workers(undef); my $clearly_needed_analyses = $statsDBA->fetch_by_needed_workers();
my $potentially_needed_analyses = $statsDBA->fetch_by_statuses(['LOADING', 'BLOCKED', 'ALL_CLAIMED']); my $potentially_needed_analyses = $statsDBA->fetch_by_statuses(['LOADING', 'BLOCKED', 'ALL_CLAIMED']);
my @all_analyses = (@$clearly_needed_analyses, @$potentially_needed_analyses); my @all_analyses = (@$clearly_needed_analyses, @$potentially_needed_analyses);
...@@ -710,6 +710,7 @@ sub schedule_workers { ...@@ -710,6 +710,7 @@ sub schedule_workers {
my %workers_to_run_by_rc_id = (); my %workers_to_run_by_rc_id = ();
my $available_load = 1.0 - $self->get_hive_current_load(); my $available_load = 1.0 - $self->get_hive_current_load();
foreach my $analysis_stats (@all_analyses) { foreach my $analysis_stats (@all_analyses) {
last if ($available_load <= 0.0); last if ($available_load <= 0.0);
last if (defined($available_submit_limit) and !$available_submit_limit); last if (defined($available_submit_limit) and !$available_submit_limit);
...@@ -747,6 +748,7 @@ sub schedule_workers { ...@@ -747,6 +748,7 @@ sub schedule_workers {
if($pending_by_rc_id{ $curr_rc_id }) { # per-rc_id capping by pending processes, if available if($pending_by_rc_id{ $curr_rc_id }) { # per-rc_id capping by pending processes, if available
my $pending_this_analysis = ($pending_by_rc_id{ $curr_rc_id } < $workers_this_analysis) ? $pending_by_rc_id{ $curr_rc_id } : $workers_this_analysis; my $pending_this_analysis = ($pending_by_rc_id{ $curr_rc_id } < $workers_this_analysis) ? $pending_by_rc_id{ $curr_rc_id } : $workers_this_analysis;
print "Scheduler detected $pending_this_analysis pending workers with rc_id=$curr_rc_id\n";
$workers_this_analysis -= $pending_this_analysis; $workers_this_analysis -= $pending_this_analysis;
$pending_by_rc_id{ $curr_rc_id } -= $pending_this_analysis; $pending_by_rc_id{ $curr_rc_id } -= $pending_this_analysis;
} }
......
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