Last change
on this file since 329 was
286,
checked in by bas, 11 years ago
|
PBSacct framework for accounting records, beta
list some changes
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
File size:
927 bytes
|
Rev | Line | |
---|
[72] | 1 | #!/usr/bin/env python |
---|
| 2 | # |
---|
| 3 | # Author: Bas van der Vlies <basv@sara.nl> |
---|
| 4 | # Date : 02 March 2005 |
---|
| 5 | # Desc. : Usage of the new PBSQuery module |
---|
| 6 | # |
---|
| 7 | # SVN info: |
---|
| 8 | # $Id: new_interface.py 286 2012-12-20 11:01:00Z bas $ |
---|
| 9 | # |
---|
| 10 | # |
---|
| 11 | # |
---|
| 12 | |
---|
[286] | 13 | import pbs |
---|
[72] | 14 | from PBSQuery import PBSQuery |
---|
[204] | 15 | from PBSQuery import PBSError |
---|
[72] | 16 | |
---|
[204] | 17 | import sys |
---|
| 18 | |
---|
[72] | 19 | def main(): |
---|
| 20 | |
---|
| 21 | p = PBSQuery() |
---|
[190] | 22 | p.new_data_structure() |
---|
[72] | 23 | |
---|
[204] | 24 | #job = p.getjob('2983215') |
---|
| 25 | #print job['substate'] |
---|
| 26 | #print job.substate |
---|
| 27 | #print job.queue |
---|
| 28 | #print job.Resource_List |
---|
| 29 | #print job.Resource_List.nodes |
---|
| 30 | #print job.Resource_List.arch |
---|
| 31 | #print job.Variable_List.PBS_O_HOME |
---|
| 32 | |
---|
[286] | 33 | l = ['np', 'state' ] |
---|
| 34 | node = p.getnode("gb-r5n1", l) |
---|
| 35 | print node.name, node['np'] |
---|
| 36 | |
---|
| 37 | sys.exit(0) |
---|
| 38 | |
---|
| 39 | #nodes = p.getnodes(l) |
---|
[190] | 40 | for id in nodes: |
---|
[204] | 41 | print id |
---|
[72] | 42 | |
---|
[204] | 43 | try: |
---|
| 44 | print nodes[id].np |
---|
| 45 | print nodes[id].status.arch |
---|
| 46 | print nodes[id].status.uname |
---|
| 47 | print nodes[id].state |
---|
| 48 | except PBSError, detail: |
---|
| 49 | print detail |
---|
| 50 | pass |
---|
| 51 | |
---|
| 52 | #for attrib in nodes[id]: |
---|
| 53 | # print attrib, nodes[id][attrib] |
---|
[190] | 54 | |
---|
[72] | 55 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.