Skip to content

Commit 4402ed8

Browse files
committed
Added etime and resources_used_cpupercent, set used time to a default value.
1 parent 7c5d3d0 commit 4402ed8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pbsutils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,21 @@ def get_jobs(conn):
243243

244244
jobs = [] # This will contain a list of dictionaries.
245245

246-
# Some jobs don't yet have a particular attribute as the job hasn't started yet.
246+
# Some jobs don't yet have a particular attribute as the jobs hasn't started yet.
247247
# We have to create that key and set it to something, otherwise we get errors like:
248248
# NameError("name 'resources_used_ncpus' is not defined",)
249249
attribute_names = ['resources_used_ncpus', 'resources_used_mem', 'resources_used_vmem', \
250-
'resources_used_walltime', 'exec_host', 'exec_vnode', 'stime', 'resources_time_left']
250+
'resources_used_walltime', 'exec_vnode', 'stime', 'etime', 'resources_time_left', \
251+
'resources_used_cpupercent']
251252

252253
b = pbs.pbs_statjob(conn, '', None, None)
253254
while b != None:
254255
attributes = {} # Init the dictionary to empty.
255256
# Init the values of the attributes.
256257
for name in attribute_names:
257258
attributes[name] = ''
259+
for name in ['resources_used_walltime', 'resources_used_cput']:
260+
attributes[name] = '0:0:0'
258261

259262
attribs = b.attribs
260263
#print 'DEBUG: ----------- %s -------------------' % b.name

0 commit comments

Comments
 (0)