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
Model registry
Operate
Environments
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
tlbl
WindEnergyToolbox
Commits
f629d5d7
Commit
f629d5d7
authored
8 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
utils.cluster_tools.pbswrap: fix issue
#14
, do not crash when queue is empty
parent
cd67b855
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wetb/utils/cluster_tools/pbswrap.py
+13
-4
13 additions, 4 deletions
wetb/utils/cluster_tools/pbswrap.py
with
13 additions
and
4 deletions
wetb/utils/cluster_tools/pbswrap.py
+
13
−
4
View file @
f629d5d7
...
...
@@ -127,6 +127,8 @@ def print_node_loading(users, host, nodes, nodesload):
def
parse_pbsnode_lall
(
output
):
"""
Parse output of pbsnodes -l all
"""
# read the qstat output
frees
,
exclusives
,
others
,
down
=
0
,
0
,
0
,
0
nr_nodes
=
0
...
...
@@ -186,7 +188,7 @@ def parse_qstat_n1(output):
host
=
{}
users
=
{}
# get the hostname
hostname
=
output
[
1
]
hostname
=
socket
.
gethostname
()
if
hostname
[:
5
]
==
'
g-000
'
:
host
[
'
name
'
]
=
'
gorm
'
host
[
'
cpu_per_node
'
]
=
12
...
...
@@ -199,9 +201,13 @@ def parse_qstat_n1(output):
# who are down
#queue['_total_cpu_'] = cpu_node*nr_nodes
for
line
in
output
[
5
:]:
# first 5 are not relevant
if
line
==
""
:
ii
=
0
for
line
in
output
:
# first 5 are not relevant
if
ii
<
5
:
ii
+=
1
continue
items
=
line
.
split
()
queue
=
items
[
2
]
...
...
@@ -247,6 +253,7 @@ def parse_qstat_n1(output):
nodes
=
items
[
11
].
split
(
'
+
'
)
# TODO: take into account cpu number for jess: j-304/5
# on jess, the cpu number of the node is indicated, ignore for now
# FIXME: host name can be jess or j-
if
host
[
'
name
'
].
startswith
(
'
jess
'
):
for
i
,
node
in
enumerate
(
nodes
):
nodes
[
i
]
=
node
.
split
(
'
/
'
)[
0
]
...
...
@@ -261,9 +268,11 @@ def parse_qstat_n1(output):
except
KeyError
:
nodesload
[
node
]
=
[
userid
]
return
users
,
host
,
nodesload
ii
+=
1
return
users
,
host
,
nodesload
# FIXME: counts diffferent compared to launch.py....
def
count_cpus
(
users
,
host
,
pbsnodes
):
"""
See how many cpu
'
s are actually free
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment