/[pdpsoft]/nl.nikhef.pdp.dynsched-pbs-plugin/branches/RB-2.2.0/pbsServer.py
ViewVC logotype

Diff of /nl.nikhef.pdp.dynsched-pbs-plugin/branches/RB-2.2.0/pbsServer.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2132 by templon, Thu Jan 6 15:47:55 2011 UTC revision 2133 by templon, Fri Jan 14 12:40:11 2011 UTC
# Line 33  class LiveServer(Server): Line 33  class LiveServer(Server):
33          else:          else:
34              cmdstr = 'qstat -f'              cmdstr = 'qstat -f'
35          (stat, qstatout) = commands.getstatusoutput(cmdstr)          (stat, qstatout) = commands.getstatusoutput(cmdstr)
36            if stat:
37                print 'problem getting qstat output; cmd used was', cmdstr
38                print 'returned status ', stat, ', text: ', qstatout
39          from torque_utils import pbsnodes          from torque_utils import pbsnodes
40          cpucount = 0          cpucount = 0
41          jobcount = 0          jobcount = 0
# Line 49  class LiveServer(Server): Line 52  class LiveServer(Server):
52                    
53          keyvalpat = re.compile(r'   (\S+) = (.*)')          keyvalpat = re.compile(r'   (\S+) = (.*)')
54                    
55          verbose_job_info=string.split(qstatout,"\n\n")          # guard against empty or nonconforming qstat output
56            if len(qstatout) == 0:
57                verbose_job_info = []  # assume valid output for system with no jobs running!
58            elif qstatout.find('Job Id') != 0:
59                print 'fatal error, qstat output starts with something other than a job id'
60                print 'first few characters are:', qstatout[:min(32,len(qstatout))]
61                sys.exit(4)
62            else:
63                verbose_job_info=string.split(qstatout,"\n\n")
64    
65          for j in verbose_job_info:          for j in verbose_job_info:
66              newj = Job()              newj = Job()
67              lines = string.split(j,'\n ')              lines = string.split(j,'\n ')

Legend:
Removed from v.2132  
changed lines
  Added in v.2133

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