Commit 93c04edf authored by Leo Gordon's avatar Leo Gordon
Browse files

rc_name support in the beekeeper

parent 921f42ca
......@@ -87,13 +87,13 @@ sub kill_worker {
sub submit_workers {
my ($self, $iteration, $worker_cmd, $worker_count, $rc_id, $rc_parameters) = @_;
my ($self, $worker_cmd, $worker_count, $iteration, $rc_id, $rc_parameters) = @_;
my $cmd = "$worker_cmd -rc_id $rc_id &"; # $rc_parameters are ignored for the time being
my $cmd = "$worker_cmd &";
foreach (1..$worker_count) {
print "SUBMITTING_CMD:\t\t$cmd\n";
system($cmd);
system( $cmd );
}
}
......
......@@ -120,14 +120,14 @@ sub find_out_causes {
sub submit_workers {
my ($self, $iteration, $worker_cmd, $worker_count, $rc_id, $rc_parameters) = @_;
my ($self, $worker_cmd, $worker_count, $iteration, $rc_id, $rc_parameters) = @_;
my $job_name = $self->generate_job_name($worker_count, $iteration, $rc_id);
my $submission_options = $self->config_get('SubmissionOptions');
$ENV{'LSB_STDOUT_DIRECT'} = 'y'; # unbuffer the output of the bsub command
my $cmd = qq{bsub -o /dev/null -J "${job_name}" $rc_parameters $submission_options $worker_cmd -rc_id $rc_id};
my $cmd = qq{bsub -o /dev/null -J "${job_name}" $rc_parameters $submission_options $worker_cmd};
print "SUBMITTING_CMD:\t\t$cmd\n";
system($cmd) && die "Could not submit job(s): $!, $?"; # let's abort the beekeeper and let the user check the syntax
......
......@@ -321,6 +321,8 @@ sub run_autonomously {
my $current_meadow = $valley->get_current_meadow();
my $worker_cmd = generate_worker_cmd($self, $run_job_id);
my $rc_id2name = $self->{'dba'}->get_ResourceClassAdaptor->fetch_HASHED_FROM_name_TO_resource_class_id();
# pre-hash the resource_class xparams for future use:
my $rc_xparams = $self->{'dba'}->get_ResourceDescriptionAdaptor->fetch_by_meadow_type_HASHED_FROM_resource_class_id_TO_parameters($current_meadow->type());
......@@ -348,9 +350,11 @@ sub run_autonomously {
foreach my $rc_id ( sort { $workers_to_run_by_rc_id->{$a}<=>$workers_to_run_by_rc_id->{$b} } keys %$workers_to_run_by_rc_id) {
my $this_rc_worker_count = $workers_to_run_by_rc_id->{$rc_id};
print "Submitting $this_rc_worker_count workers (rc_id=$rc_id) to ".$current_meadow->toString()."\n";
my $rc_name = $rc_id2name->{$rc_id};
print "Submitting $this_rc_worker_count workers (rc_id=$rc_id, rc_name=$rc_name) to ".$current_meadow->toString()."\n";
$current_meadow->submit_workers($iteration, $worker_cmd, $this_rc_worker_count, $rc_id, $rc_xparams->{$rc_id} || '');
$current_meadow->submit_workers("$worker_cmd -rc_id $rc_id", $this_rc_worker_count, $iteration, $rc_id, $rc_xparams->{$rc_id} || '');
}
} else {
print "Not submitting any workers this iteration\n";
......
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