Commit 4aa343fa authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Added an interface in Meadow to deregister agents, i.e. beekeepers, so that...

Added an interface in Meadow to deregister agents, i.e. beekeepers, so that they can run local workers

This allows to "submit" beekeeper to a compute node
parent 1cf05bd9
......@@ -56,12 +56,14 @@ sub new_from_Valley {
my ($class, $valley, @args) = @_;
my ($meadow, $pid, $meadow_host, $meadow_user) = $valley->whereami;
unless($meadow->type eq 'LOCAL') {
unless($meadow->can('deregister_local_process')) {
die "beekeeper.pl detected it has been itself submitted to '".$meadow->type."/".$meadow->cached_name."', but this mode of operation is not supported.\n"
."Please just run beekeeper.pl on a farm head node, preferably from under a 'screen' session.\n";
}
$meadow->deregister_local_process();
return $class->SUPER::new(
'meadow' => $meadow_host,
'meadow_host' => $meadow_host,
'meadow_user' => $meadow_user,
'process_id' => $pid,
......@@ -141,6 +143,13 @@ sub meadow_signatures {
# --------------------------------- Convenient methods ---------------------------------------
sub meadow {
my $self = shift;
$self->{'_meadow'} = shift if(@_);
return $self->{'_meadow'};
}
=head2 set_cause_of_death
Example : $beekeeper->set_cause_of_death('LOOP_LIMIT');
......
......@@ -50,6 +50,7 @@ sub get_current_worker_process_id {
return $$;
}
sub deregister_local_process {} # Nothing to do
sub _command_line_to_extract_all_running_workers {
my ($self) = @_;
......
......@@ -72,6 +72,14 @@ sub get_current_worker_process_id {
}
sub deregister_local_process {
my ($self) = @_;
delete $ENV{'LSB_JOBID'};
delete $ENV{'LSB_JOBINDEX'};
}
sub status_of_all_our_workers { # returns an arrayref
my $self = shift @_;
my $meadow_users_of_interest = shift @_;
......
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