Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toolbox
WindEnergyToolbox
Merge requests
!6
Clustertools
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Clustertools
clustertools
into
master
Overview
0
Commits
25
Pipelines
0
Changes
1
Closed
Mads M. Pedersen
requested to merge
clustertools
into
master
9 years ago
Overview
0
Commits
25
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
1a08f099
Prev
Next
Show latest version
1 file
+
2
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
1a08f099
processes starting with <process name> counting as own process
· 1a08f099
mads
authored
9 years ago
wetb/utils/cluster_tools/cluster_resource.py
+
2
−
2
Options
@@ -69,9 +69,9 @@ class LocalResource(Resource):
try
:
return
psutil
.
Process
(
i
).
name
except
psutil
.
_error
.
AccessDenied
:
pass
return
""
no_cpu
=
multiprocessing
.
cpu_count
()
cpu_free
=
(
1
-
psutil
.
cpu_percent
(.
5
)
/
100
)
*
no_cpu
no_current_process
=
len
([
i
for
i
in
psutil
.
get_pid_list
()
if
name
(
i
)
==
self
.
process_name
])
no_current_process
=
len
([
i
for
i
in
psutil
.
get_pid_list
()
if
name
(
i
)
.
lower
().
startswith
(
self
.
process_name
.
lower
())
])
return
no_cpu
,
cpu_free
,
no_current_process
Loading