/[pdpsoft]/nl.nikhef.pdp.dynsched-pbs-plugin/branches/RB-2.2.2/lrmsinfo-pbs.cin
ViewVC logotype

Contents of /nl.nikhef.pdp.dynsched-pbs-plugin/branches/RB-2.2.2/lrmsinfo-pbs.cin

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2257 - (show annotations) (download)
Tue Apr 5 12:32:28 2011 UTC (11 years, 4 months ago) by templon
File size: 1216 byte(s)
- removed compile-time path from lrmsinfo-pbs; system path will be used
- for in-place installs, use PYTHONPATH on the command line
- document changes in RELEASE file
- changes in Makefile to have python libs installed in standard places


1 #!/usr/bin/python2
2 # lrmsinfo-pbs
3 # J. A. Templon, NIKHEF/PDP 2005
4 # $Id$
5 # $URL$
6
7 # get information from pbs/torque LRMS, spit it out in uniform format
8
9 def usage():
10 print "Usage: lrmsinfo-pbs [-i <input_file>]"
11 print " input_file : optional text file containing 'qstat -f' output"
12
13 import sys, getopt, string
14
15 try:
16 opts, args = getopt.getopt(sys.argv[1:], "i:",
17 ["input="])
18 except getopt.GetoptError:
19 # print help information and exit:
20 print sys.argv[0] + ": error parsing command line: " + \
21 string.join(sys.argv)
22 usage()
23 sys.exit(2)
24
25 infile = None
26
27 for o, a in opts:
28 if o in ("-i", "--input"):
29 infile = a
30
31 if infile:
32 cmd = '/bin/cat ' + infile
33 else:
34 cmd = 'diagnose -g'
35
36 from pbsServer import LiveServer
37 if infile:
38 bq = LiveServer(file=infile)
39 else:
40 bq = LiveServer()
41
42 tf = sys.stdout
43 tf.write("nactive %d\n" % (bq.slotsUp))
44 tf.write("nfree %d\n" % (bq.slotsFree))
45 tf.write("now %d\n" % (bq.now))
46 tf.write("schedCycle %d\n" % (bq.schedCycle))
47
48 for job in bq.jobs():
49 tf.write(job.attDictString() + "\n")
50
51 tf.close()
52
53 ### Local Variables: ***
54 ### mode: python ***
55 ### End: ***

Properties

Name Value
svn:eol-style native
svn:keywords Id URL

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28