- Timestamp:
- 04/12/18 13:27:11 (6 years ago)
- Location:
- trunk/examples
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/JobParser.py
r356 r361 6 6 # and convert them to a attropl list which can be used for submission 7 7 # 8 8 from __future__ import print_function 9 9 import re 10 10 import sys -
trunk/examples/ha_server.py
r356 r361 11 11 # 12 12 import sys 13 13 from __future__ import print_function 14 14 import pbs 15 15 16 16 def method1(): 17 18 19 20 17 pbs_server = pbs.pbs_default() 18 if not pbs_server: 19 print("No default pbs server") 20 sys.exit(1) 21 21 22 23 24 25 26 27 28 29 30 31 32 33 22 con = pbs.pbs_connect(pbs_server) 23 if con == -1: 24 print("Default pbs server connection failed") 25 pbs_server = pbs.pbs_fbserver() 26 if not pbs_server: 27 print("No pbs fallback server") 28 sys.exit(1) 29 else: 30 con = pbs.pbs_connect(pbs_server) 31 if con == -1: 32 print("pbs fallback server connection failed") 33 sys.exit(1) 34 34 35 35 print("Connected to %s" %(pbs_server)) 36 36 37 37 def method2(): 38 39 40 41 42 43 44 45 46 47 38 try: 39 server_list = pbs.pbs_get_server_list().split(',') 40 except AttributeError, detail: 41 print('The installed torque version does not support pbs_get_server_list function') 42 sys.exit(1) 43 for server in server_list: 44 pbs_server = server 45 con = pbs.pbs_connect(server) 46 if con != -1: 47 break 48 48 49 50 51 49 if con == -1: 50 print('Could not connect to a server (%s)' %('.'.join(server_list))) 51 sys.exit(1) 52 52 53 53 print("Connected to %s" %(pbs_server)) 54 54 55 55 -
trunk/examples/logpbs.py
r356 r361 7 7 # $Id$ 8 8 # 9 from __future__ import print_function 9 10 import pbs 10 11 import sys -
trunk/examples/new_interface.py
r356 r361 10 10 # 11 11 # 12 12 from __future__ import print_function 13 13 import pbs 14 14 from PBSQuery import PBSQuery … … 41 41 #nodes = p.getnodes(l) 42 42 for id in nodes: 43 43 print(id) 44 44 45 46 47 48 49 50 51 52 53 45 try: 46 print(nodes[id].np) 47 print(nodes[id].status.arch) 48 print(nodes[id].status.uname) 49 print(nodes[id].state) 50 except PBSError, detail: 51 print(detail) 52 pass 53 54 54 #for attrib in nodes[id]: 55 # 55 # print attrib, nodes[id][attrib] 56 56 57 57 main() -
trunk/examples/new_rack_pbsmon.py
r321 r361 27 27 The ranges ([]) are not only limited to numbers, letters can also be used. 28 28 """ 29 29 from __future__ import print_function 30 30 import sys 31 31 import re -
trunk/examples/node_event_parse.py
r356 r361 12 12 # 13 13 14 14 from __future__ import print_function 15 15 import pbs 16 16 import sys -
trunk/examples/pbs_version.py
r356 r361 8 8 # 9 9 # 10 from __future__ import print_function 10 11 import sys 11 12 import pbs -
trunk/examples/pbsnodes-a.py
r356 r361 11 11 # 12 12 13 13 from __future__ import print_function 14 14 import pbs 15 15 import sys -
trunk/examples/resmom_info.py
r356 r361 7 7 # $Id$ 8 8 # 9 from __future__ import print_function 9 10 import pbs 10 11 import sys -
trunk/examples/sara_nodes.py
r346 r361 18 18 ALLOWED_STATES = set(['down', 'offline', 'unknown']) 19 19 20 from __future__ import print_function 20 21 import pbs 21 22 import PBSQuery -
trunk/examples/set_property.py
r356 r361 10 10 # 11 11 # 12 from __future__ import print_function 12 13 import sys 13 14 import pbs … … 20 21 21 22 if len(sys.argv) < 2: 22 23 23 print("Usage: set_property.py <hostname>") 24 sys.exit(1) 24 25 25 26 hostname = sys.argv[1]
Note: See TracChangeset
for help on using the changeset viewer.