-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew_interface.py
executable file
·57 lines (45 loc) · 995 Bytes
/
new_interface.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
#
# Author: Bas van der Vlies <[email protected]>
# Date : 02 March 2005
# Desc. : Usage of the new PBSQuery module
#
# SVN info:
# $Id: new_interface.py 339 2015-03-10 16:55:29Z bas $
#
#
#
import pbs
from PBSQuery import PBSQuery
from PBSQuery import PBSError
import sys
def main():
p = PBSQuery()
p.new_data_structure()
#job = p.getjob('2983215')
#print job['substate']
#print job.substate
#print job.queue
#print job.Resource_List
#print job.Resource_List.nodes
#print job.Resource_List.arch
#print job.Variable_List.PBS_O_HOME
l = ['np', 'state' ]
#node = p.getnode("r2n2", l)
#print node.name
#print node.name, node['np']
#sys.exit(0)
nodes = p.getnodes(l)
for id in nodes:
print id
try:
print nodes[id].np
#print nodes[id].status.arch
print nodes[id].status.uname
print nodes[id].state
except PBSError, detail:
print detail
pass
#for attrib in nodes[id]:
# print attrib, nodes[id][attrib]
main()