Commit 25ab8993 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Queen can enquire the Valley itself

parent 9f77cf0f
......@@ -74,6 +74,7 @@ use List::Util qw(max);
use Bio::EnsEMBL::Hive::Utils ('destringify', 'dir_revhash'); # NB: needed by invisible code
use Bio::EnsEMBL::Hive::Role;
use Bio::EnsEMBL::Hive::Scheduler;
use Bio::EnsEMBL::Hive::Valley;
use Bio::EnsEMBL::Hive::Worker;
use base ('Bio::EnsEMBL::Hive::DBSQL::ObjectAdaptor');
......@@ -111,11 +112,14 @@ sub create_new_worker {
my $self = shift @_;
my %flags = @_;
my ($meadow_type, $meadow_name, $process_id, $meadow_host, $meadow_user, $resource_class_id, $resource_class_name, $beekeeper_id,
my ($resource_class_id, $resource_class_name, $beekeeper_id,
$no_write, $debug, $worker_log_dir, $hive_log_dir, $job_limit, $life_span, $no_cleanup, $retry_throwing_jobs, $can_respecialize)
= @flags{qw(-meadow_type -meadow_name -process_id -meadow_host -meadow_user -resource_class_id -resource_class_name -beekeeper_id
= @flags{qw(-resource_class_id -resource_class_name -beekeeper_id
-no_write -debug -worker_log_dir -hive_log_dir -job_limit -life_span -no_cleanup -retry_throwing_jobs -can_respecialize)};
my ($meadow_type, $meadow_name, $process_id, $meadow_host, $meadow_user) = Bio::EnsEMBL::Hive::Valley->new()->whereami();
die "Valley is not fully defined" unless ($meadow_type && $meadow_name && $process_id && $meadow_host && $meadow_user);
foreach my $prev_worker_incarnation (@{ $self->fetch_all( "status!='DEAD' AND meadow_type='$meadow_type' AND meadow_name='$meadow_name' AND process_id='$process_id'" ) }) {
# so far 'RELOCATED events' has been detected on LSF 9.0 in response to sending signal #99 or #100
# Since I don't know how to avoid them, I am trying to register them when they happen.
......
......@@ -44,9 +44,6 @@ sub runWorker {
my $queen = $hive_dba->get_Queen();
die "No Queen, God Bless Her\n" unless $queen and $queen->isa('Bio::EnsEMBL::Hive::Queen');
my ($meadow_type, $meadow_name, $process_id, $meadow_host, $meadow_user) = Bio::EnsEMBL::Hive::Valley->new()->whereami();
die "Valley is not fully defined" unless ($meadow_type && $meadow_name && $process_id && $meadow_host && $meadow_user);
if( $specialization_options->{'force_sync'} ) { # sync the Hive in Test mode:
my $list_of_analyses = $pipeline->collection_of('Analysis')->find_all_by_pattern( $specialization_options->{'analyses_pattern'} );
......@@ -55,12 +52,7 @@ sub runWorker {
# Create the worker
my $worker = $queen->create_new_worker(
# Worker identity:
-meadow_type => $meadow_type,
-meadow_name => $meadow_name,
-process_id => $process_id,
-meadow_host => $meadow_host,
-meadow_user => $meadow_user,
# Resource class:
-resource_class_id => $specialization_options->{'resource_class_id'},
-resource_class_name => $specialization_options->{'resource_class_name'},
-beekeeper_id => $specialization_options->{'beekeeper_id'},
......
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