Commit d72e9cf8 authored by Jessica Severin's avatar Jessica Severin
Browse files

added -process_id option to Queen:create_new_worker method to allow external

setting (e.g. lsf job_id and array_index
parent 8db874e8
...@@ -88,8 +88,8 @@ our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor); ...@@ -88,8 +88,8 @@ our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
sub create_new_worker { sub create_new_worker {
my ($self, @args) = @_; my ($self, @args) = @_;
my ($analysis_id, $beekeeper) = my ($analysis_id, $beekeeper ,$pid) =
rearrange([qw(analysis_id beekeeper )], @args); rearrange([qw(analysis_id beekeeper process_id) ], @args);
my $analStatsDBA = $self->db->get_AnalysisStatsAdaptor; my $analStatsDBA = $self->db->get_AnalysisStatsAdaptor;
return undef unless($analStatsDBA); return undef unless($analStatsDBA);
...@@ -115,11 +115,11 @@ sub create_new_worker { ...@@ -115,11 +115,11 @@ sub create_new_worker {
} }
my $host = hostname; my $host = hostname;
my $ppid = getppid; $pid = getppid unless($pid);
$beekeeper = '' unless($beekeeper); $beekeeper = '' unless($beekeeper);
my $sql = "INSERT INTO hive SET born=now(), last_check_in=now()". my $sql = "INSERT INTO hive SET born=now(), last_check_in=now()".
",process_id='$ppid' ". ",process_id='$pid' ".
",analysis_id='$analysis_id' ". ",analysis_id='$analysis_id' ".
",beekeeper='$beekeeper' ". ",beekeeper='$beekeeper' ".
",host='$host'"; ",host='$host'";
...@@ -313,7 +313,7 @@ sub get_num_needed_workers { ...@@ -313,7 +313,7 @@ sub get_num_needed_workers {
last if($availableLoad <= 0.0); last if($availableLoad <= 0.0);
} }
print("need $numWorkers workers ($availableLoad load left)\n"); printf("need $numWorkers workers (availLoad=%1.5f)\n", $availableLoad);
return $numWorkers; return $numWorkers;
} }
......
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