Skip to content
Snippets Groups Projects
Commit 406042e7 authored by David Verelst's avatar David Verelst
Browse files

Merge branch 'pbswrap_mmpe_fix' into 'master'

add optional host parameter in parse_qstat_n1

When called on local machine with output from qstat on cluster, the socket.gethostname returns the name of the local machine instead of the cluster
With this change the host name can be specified (optionally)

See merge request !16
parents 055fc752 24589bc0
No related branches found
No related tags found
1 merge request!16add optional host parameter in parse_qstat_n1
Pipeline #
......@@ -176,7 +176,7 @@ def parse_pbsnode_lall(output):
return pbsnodes, nodes
def parse_qstat_n1(output):
def parse_qstat_n1(output, hostname=None):
"""
Parse the output of qstat -n1
"""
......@@ -188,26 +188,22 @@ def parse_qstat_n1(output):
host = {}
users = {}
# get the hostname
hostname = socket.gethostname()
if hostname[:5] == 'g-000':
host['name'] = 'gorm'
host['cpu_per_node'] = 12
else:
# 272 nodes are 2 x 10 core (twenty) processors
if hostname is None:
hostname = socket.gethostname()
if 'jess' in hostname:
host['name'] = 'jess'
#total_nodes = 80
host['cpu_per_node'] = 20
else:
host['name'] = 'gorm'
host['cpu_per_node'] = 12
# take the available nodes in nr_nodes: it excludes the ones
# who are down
#queue['_total_cpu_'] = cpu_node*nr_nodes
ii = 0
for line in output:
# first 5 are not relevant
if ii < 5:
ii += 1
for line in output[5:]:
if len(line.strip()) == 0:
continue
items = line.split()
queue = items[2]
......@@ -268,8 +264,6 @@ def parse_qstat_n1(output):
except KeyError:
nodesload[node] = [userid]
ii += 1
return users, host, nodesload
# FIXME: counts diffferent compared to launch.py....
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment