Commit 86c7c154 authored by Leo Gordon's avatar Leo Gordon
Browse files

api_change: beekeeper passes only the submit_log_dir to the Meadow, which may...

api_change: beekeeper passes only the submit_log_dir to the Meadow, which may then decide how to capture submission logs best (thanks, Lel!)
parent 02e0979e
......@@ -122,7 +122,7 @@ sub kill_worker {
sub submit_workers {
my ($self, $worker_cmd, $required_worker_count, $iteration, $rc_name, $rc_specific_submission_cmd_args, $submit_stdout_file, $submit_stderr_file) = @_;
my ($self, $worker_cmd, $required_worker_count, $iteration, $rc_name, $rc_specific_submission_cmd_args, $submit_log_subdir) = @_;
my $cmd = "$worker_cmd &";
......
......@@ -287,14 +287,21 @@ sub get_report_entries_for_time_interval {
sub submit_workers {
my ($self, $worker_cmd, $required_worker_count, $iteration, $rc_name, $rc_specific_submission_cmd_args, $submit_stdout_file, $submit_stderr_file) = @_;
my ($self, $worker_cmd, $required_worker_count, $iteration, $rc_name, $rc_specific_submission_cmd_args, $submit_log_subdir) = @_;
my $job_array_common_name = $self->job_array_common_name($rc_name, $iteration);
my $job_array_name_with_indices = $job_array_common_name . (($required_worker_count > 1) ? "[1-${required_worker_count}]" : '');
my $meadow_specific_submission_cmd_args = $self->config_get('SubmissionOptions');
$submit_stdout_file ||= '/dev/null'; # a value is required
$submit_stderr_file ||= '/dev/null'; # a value is required
my ($submit_stdout_file, $submit_stderr_file);
if($submit_log_subdir) {
$submit_stdout_file = $submit_log_subdir . "/log_${rc_name}_%J_%I.out";
$submit_stderr_file = $submit_log_subdir . "/log_${rc_name}_%J_%I.err";
} else {
$submit_stdout_file = '/dev/null';
$submit_stderr_file = '/dev/null';
}
$ENV{'LSB_STDOUT_DIRECT'} = 'y'; # unbuffer the output of the bsub command
......
......@@ -67,8 +67,6 @@ sub main {
$self->{'retry_throwing_jobs'} = undef;
$self->{'can_respecialize'} = undef;
$self->{'hive_log_dir'} = undef;
$self->{'submit_stdout_file'} = undef;
$self->{'submit_stderr_file'} = undef;
$self->{'submit_log_dir'} = undef;
GetOptions(
......@@ -103,8 +101,6 @@ sub main {
'retry_throwing_jobs=i' => \$self->{'retry_throwing_jobs'},
'can_respecialize=i' => \$self->{'can_respecialize'},
'debug=i' => \$self->{'debug'},
'submit_stdout_file=s' => \$self->{'submit_stdout_file'},
'submit_stderr_file=s' => \$self->{'submit_stderr_file'},
'submit_log_dir=s' => \$self->{'submit_log_dir'},
# other commands/options
......@@ -379,14 +375,8 @@ sub run_autonomously {
. " -rc_name $rc_name"
. (defined($worker_cmd_args) ? " $worker_cmd_args" : '');
if( $self->{'submit_log_dir'} ) {
$self->{'submit_stdout_file'} = $submit_log_subdir . "/log_${rc_name}_%J_%I.out";
$self->{'submit_stderr_file'} = $submit_log_subdir . "/log_${rc_name}_%J_%I.err";
}
$this_meadow->submit_workers($specific_worker_cmd, $this_meadow_rc_worker_count, $iteration,
$rc_name, $submission_cmd_args || '',
$self->{'submit_stdout_file'}, $self->{'submit_stderr_file'});
$rc_name, $submission_cmd_args || '', $submit_log_subdir);
}
}
} else {
......
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