Commit 6dda6ab4 authored by Brandon Walts's avatar Brandon Walts

Merge branch 'version/2.1' into version/2.2

parents 7765fe85 87b9e8f9
...@@ -87,18 +87,20 @@ sub count_pending_workers_by_rc_name { ...@@ -87,18 +87,20 @@ sub count_pending_workers_by_rc_name {
my ($self) = @_; my ($self) = @_;
my $jnp = $self->job_name_prefix(); my $jnp = $self->job_name_prefix();
my $cmd = "bjobs -w -J '${jnp}*' 2>/dev/null | grep PEND"; # "-u all" has been removed to ensure one user's PEND processes my @bjobs_out = qx{bjobs -w -J '${jnp}*' 2>/dev/null}; # "-u all" has been removed to ensure one user's PEND processes
# do not affect another user helping to run the same pipeline. # do not affect another user helping to run the same pipeline.
# warn "LSF::count_pending_workers_by_rc_name() running cmd:\n\t$cmd\n"; # warn "LSF::count_pending_workers_by_rc_name() running cmd:\n\t$cmd\n";
my %pending_this_meadow_by_rc_name = (); my %pending_this_meadow_by_rc_name = ();
my $total_pending_this_meadow = 0; my $total_pending_this_meadow = 0;
foreach my $line (qx/$cmd/) { foreach my $line (@bjobs_out) {
if($line=~/\b\Q$jnp\E(\S+)\-\d+(\[\d+\])?\b/) { if ($line=~/PEND/) {
$pending_this_meadow_by_rc_name{$1}++; if($line=~/\b\Q$jnp\E(\S+)\-\d+(\[\d+\])?\b/) {
$total_pending_this_meadow++; $pending_this_meadow_by_rc_name{$1}++;
$total_pending_this_meadow++;
}
} }
} }
...@@ -110,12 +112,11 @@ sub count_running_workers { ...@@ -110,12 +112,11 @@ sub count_running_workers {
my ($self) = @_; my ($self) = @_;
my $jnp = $self->job_name_prefix(); my $jnp = $self->job_name_prefix();
my $cmd = "bjobs -w -J '${jnp}*' -u all 2>/dev/null | grep RUN | wc -l"; my @bjobs_out = qx{bjobs -w -J '${jnp}*' -u all 2>/dev/null};
# warn "LSF::count_running_workers() running cmd:\n\t$cmd\n"; # warn "LSF::count_running_workers() running cmd:\n\t$cmd\n";
my $run_count = qx/$cmd/; my $run_count = scalar(grep {/RUN/} @bjobs_out);
$run_count=~s/\s+//g; # remove both leading and trailing spaces
return $run_count; return $run_count;
} }
......
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