Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pbsutils
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
toolbox
pbsutils
Commits
24715f2f
Commit
24715f2f
authored
8 years ago
by
David Verelst
Browse files
Options
Downloads
Patches
Plain Diff
remove print statement brackets for PY3 compat again: prints prettier
parent
d111a8be
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
pbswrap.py
+31
-31
31 additions, 31 deletions
pbswrap.py
with
31 additions
and
31 deletions
pbswrap.py
+
31
−
31
View file @
24715f2f
...
@@ -22,14 +22,14 @@ def print_dashboard(users, host, pbsnodes):
...
@@ -22,14 +22,14 @@ def print_dashboard(users, host, pbsnodes):
# jber 3 0 0 0
# jber 3 0 0 0
print
print
print
(
'
-
'
*
54
)
print
'
-
'
*
54
print
(
'
cpus
'
.
rjust
(
18
)
+
'
nodes
'
.
rjust
(
9
)
)
print
'
cpus
'
.
rjust
(
18
)
+
'
nodes
'
.
rjust
(
9
)
print
(
'
User
'
.
rjust
(
9
)
+
'
Running
'
.
rjust
(
9
)
+
'
Running
'
.
rjust
(
9
)
\
print
'
User
'
.
rjust
(
9
)
+
'
Running
'
.
rjust
(
9
)
+
'
Running
'
.
rjust
(
9
)
\
+
'
Queued
'
.
rjust
(
9
)
+
'
Waiting
'
.
rjust
(
9
)
+
'
Other
'
.
rjust
(
9
)
)
+
'
Queued
'
.
rjust
(
9
)
+
'
Waiting
'
.
rjust
(
9
)
+
'
Other
'
.
rjust
(
9
)
# nodeSum: overview (summation of all jobs) nodes per user:
# nodeSum: overview (summation of all jobs) nodes per user:
# nodeSum = [running, queued, waiting, other, cpus]
# nodeSum = [running, queued, waiting, other, cpus]
nodeSum
=
[
0
,
0
,
0
,
0
,
0
]
nodeSum
=
[
0
,
0
,
0
,
0
,
0
]
print
(
'
-
'
*
54
)
print
'
-
'
*
54
# print all values in the table: the nodes used per user
# print all values in the table: the nodes used per user
#userlist = users['users'].keys()
#userlist = users['users'].keys()
#userlist.sort()
#userlist.sort()
...
@@ -47,8 +47,8 @@ def print_dashboard(users, host, pbsnodes):
...
@@ -47,8 +47,8 @@ def print_dashboard(users, host, pbsnodes):
+
users
[
uid
][
'
S
'
]
+
users
[
uid
][
'
O
'
]
+
users
[
uid
][
'
C
'
]
+
users
[
uid
][
'
S
'
]
+
users
[
uid
][
'
O
'
]
+
users
[
uid
][
'
C
'
]
cpus
=
users
[
uid
][
'
cpus
'
]
cpus
=
users
[
uid
][
'
cpus
'
]
print
(
uid
.
rjust
(
9
)
+
str
(
cpus
).
rjust
(
9
)
+
str
(
R
).
rjust
(
9
)
\
print
uid
.
rjust
(
9
)
+
str
(
cpus
).
rjust
(
9
)
+
str
(
R
).
rjust
(
9
)
\
+
str
(
Q
).
rjust
(
9
)
+
str
(
W
).
rjust
(
9
)
+
str
(
O
).
rjust
(
9
)
)
+
str
(
Q
).
rjust
(
9
)
+
str
(
W
).
rjust
(
9
)
+
str
(
O
).
rjust
(
9
)
nodeSum
[
0
]
+=
R
nodeSum
[
0
]
+=
R
nodeSum
[
1
]
+=
Q
nodeSum
[
1
]
+=
Q
nodeSum
[
2
]
+=
W
nodeSum
[
2
]
+=
W
...
@@ -61,15 +61,15 @@ def print_dashboard(users, host, pbsnodes):
...
@@ -61,15 +61,15 @@ def print_dashboard(users, host, pbsnodes):
total_cpu
=
host
[
'
cpu_per_node
'
]
*
nr_nodes
total_cpu
=
host
[
'
cpu_per_node
'
]
*
nr_nodes
# the summed up for each node status (queued, running,...)
# the summed up for each node status (queued, running,...)
print
(
'
-
'
*
54
)
print
'
-
'
*
54
print
(
'
total
'
.
rjust
(
9
)
+
str
(
nodeSum
[
4
]).
rjust
(
9
)
+
str
(
nodeSum
[
0
]).
rjust
(
9
)
\
print
'
total
'
.
rjust
(
9
)
+
str
(
nodeSum
[
4
]).
rjust
(
9
)
+
str
(
nodeSum
[
0
]).
rjust
(
9
)
\
+
str
(
nodeSum
[
1
]).
rjust
(
9
)
+
str
(
nodeSum
[
2
]).
rjust
(
9
)
\
+
str
(
nodeSum
[
1
]).
rjust
(
9
)
+
str
(
nodeSum
[
2
]).
rjust
(
9
)
\
+
str
(
nodeSum
[
3
]).
rjust
(
9
)
)
+
str
(
nodeSum
[
3
]).
rjust
(
9
)
print
(
'
-
'
*
54
)
print
'
-
'
*
54
print
(
'
free
'
.
rjust
(
9
)
+
str
(
total_cpu
-
nodeSum
[
4
]).
rjust
(
9
)
\
print
'
free
'
.
rjust
(
9
)
+
str
(
total_cpu
-
nodeSum
[
4
]).
rjust
(
9
)
\
+
str
(
nr_nodes
-
nodeSum
[
0
]
-
others
-
down
).
rjust
(
9
)
)
+
str
(
nr_nodes
-
nodeSum
[
0
]
-
others
-
down
).
rjust
(
9
)
print
(
'
down
'
.
rjust
(
9
)
+
str
(
down
).
rjust
(
18
)
)
print
'
down
'
.
rjust
(
9
)
+
str
(
down
).
rjust
(
18
)
print
(
'
-
'
*
54
)
print
'
-
'
*
54
print
print
...
@@ -79,7 +79,7 @@ def print_node_loading(users, host, nodes, nodesload):
...
@@ -79,7 +79,7 @@ def print_node_loading(users, host, nodes, nodesload):
"""
"""
if
len
(
host
)
<
1
:
if
len
(
host
)
<
1
:
print
(
'
It is very quit, nobody is working on the cluster.
'
)
print
'
It is very quit, nobody is working on the cluster.
'
return
return
hostname
=
host
[
'
name
'
]
hostname
=
host
[
'
name
'
]
...
@@ -88,15 +88,15 @@ def print_node_loading(users, host, nodes, nodesload):
...
@@ -88,15 +88,15 @@ def print_node_loading(users, host, nodes, nodesload):
print
print
# print a header
# print a header
if
hostname
==
'
gorm
'
:
if
hostname
==
'
gorm
'
:
print
(
'
-
'
*
79
)
print
'
-
'
*
79
header
=
'
|
'
.
join
([
str
(
k
).
center
(
5
)
for
k
in
range
(
1
,
13
,
1
)])
+
'
|
'
header
=
'
|
'
.
join
([
str
(
k
).
center
(
5
)
for
k
in
range
(
1
,
13
,
1
)])
+
'
|
'
print
(
'
id
'
.
center
(
5
),
header
)
print
'
id
'
.
center
(
5
),
header
print
(
'
-
'
*
79
)
print
'
-
'
*
79
elif
hostname
==
'
jess
'
:
elif
hostname
==
'
jess
'
:
print
(
'
-
'
*
126
)
print
'
-
'
*
126
header
=
'
|
'
.
join
([
str
(
k
).
center
(
5
)
for
k
in
range
(
1
,
21
,
1
)])
+
'
|
'
header
=
'
|
'
.
join
([
str
(
k
).
center
(
5
)
for
k
in
range
(
1
,
21
,
1
)])
+
'
|
'
print
(
'
id
'
.
center
(
5
),
header
)
print
'
id
'
.
center
(
5
),
header
print
(
'
-
'
*
126
)
print
'
-
'
*
126
# print who is using the nodes
# print who is using the nodes
for
node
in
sorted
(
nodes
):
for
node
in
sorted
(
nodes
):
...
@@ -112,17 +112,17 @@ def print_node_loading(users, host, nodes, nodesload):
...
@@ -112,17 +112,17 @@ def print_node_loading(users, host, nodes, nodesload):
except
KeyError
:
except
KeyError
:
printlist
=
status
.
center
(
5
)
printlist
=
status
.
center
(
5
)
print
(
node
,
printlist
)
print
node
,
printlist
# print a header
# print a header
if
hostname
==
'
gorm
'
:
if
hostname
==
'
gorm
'
:
print
(
'
-
'
*
79
)
print
'
-
'
*
79
print
(
'
id
'
.
center
(
5
),
header
)
print
'
id
'
.
center
(
5
),
header
print
(
'
-
'
*
79
)
print
'
-
'
*
79
elif
hostname
==
'
jess
'
:
elif
hostname
==
'
jess
'
:
print
(
'
-
'
*
126
)
print
'
-
'
*
126
print
(
'
id
'
.
center
(
5
),
header
)
print
'
id
'
.
center
(
5
),
header
print
(
'
-
'
*
126
)
print
'
-
'
*
126
#print
#print
...
@@ -342,8 +342,8 @@ def create_input(walltime='00:59:59', queue='xpresq', pbs_in='pbs_in/', ppn=1,
...
@@ -342,8 +342,8 @@ def create_input(walltime='00:59:59', queue='xpresq', pbs_in='pbs_in/', ppn=1,
pbs_script
=
pbs_script
.
replace
(
'
[queue]
'
,
queue
)
pbs_script
=
pbs_script
.
replace
(
'
[queue]
'
,
queue
)
pbs_script
=
pbs_script
.
replace
(
'
[commands]
'
,
commands
)
pbs_script
=
pbs_script
.
replace
(
'
[commands]
'
,
commands
)
print
(
'
following commands will be executed on the cluster:
'
)
print
'
following commands will be executed on the cluster:
'
print
(
'
%s
'
%
(
commands
)
)
print
'
%s
'
%
(
commands
)
# make sure a pbs_in and pbs_out directory exists
# make sure a pbs_in and pbs_out directory exists
if
not
os
.
path
.
exists
(
pbs_in
):
if
not
os
.
path
.
exists
(
pbs_in
):
...
...
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