Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
ensembl-hive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Jira
Jira
Merge Requests
7
Merge Requests
7
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
8cfb172d
Commit
8cfb172d
authored
Jul 03, 2018
by
Brandon Walts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix [
ENSCORESW-2765
] : stop calling out to system grep when counting workers
parent
3f7fb341
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
+10
-9
No files found.
modules/Bio/EnsEMBL/Hive/Meadow/LSF.pm
View file @
8cfb172d
...
...
@@ -84,18 +84,20 @@ sub count_pending_workers_by_rc_name {
my
(
$self
)
=
@_
;
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
# do not affect another user helping to run the same pipeline.
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.
# warn "LSF::count_pending_workers_by_rc_name() running cmd:\n\t$cmd\n";
my
%pending_this_meadow_by_rc_name
=
();
my
$total_pending_this_meadow
=
0
;
foreach
my
$line
(
qx/$cmd/
)
{
if
(
$line
=~
/\b\Q$jnp\E(\S+)\-\d+(\[\d+\])?\b/
)
{
$pending_this_meadow_by_rc_name
{
$
1
}
++
;
$total_pending_this_meadow
++
;
foreach
my
$line
(
@bjobs_out
)
{
if
(
$line
=~
/PEND/
)
{
if
(
$line
=~
/\b\Q$jnp\E(\S+)\-\d+(\[\d+\])?\b/
)
{
$pending_this_meadow_by_rc_name
{
$
1
}
++
;
$total_pending_this_meadow
++
;
}
}
}
...
...
@@ -107,12 +109,11 @@ sub count_running_workers {
my
(
$self
)
=
@_
;
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";
my
$run_count
=
qx/$cmd/
;
$run_count
=~
s/\s+//g
;
# remove both leading and trailing spaces
my
$run_count
=
scalar
(
grep
{
/RUN/
}
@bjobs_out
);
return
$run_count
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment