wiki:TorqueUsage/Scripts/QueryResources

Query Resources

#!/usr/bin/env python

import pbs

c = pbs.pbs_connect(pbs.pbs_default())

# Get info from batch system how many nodes are available, allocated, 
# reserved, down
#
l = []
l.append('nodes')
r = pbs.pbs_rescquery(c, l, len(l))
print r

# Can we allocate a node with infiniband property 
#
l = []
l.append('nodes=1:infiniband')
r = pbs.pbs_rescquery(c, l, len(l))
print r

# We do not have a node with property 'bas' 
#
l = []
l.append('nodes=1:bas')
r = pbs.pbs_rescquery(c, l, len(l))
print r

Last modified 18 years ago Last modified on 09/13/06 12:42:58