/[pdpsoft]/nl.nikhef.pdp.dynsched-pbs-plugin/trunk/torqueJobs.py
ViewVC logotype

Diff of /nl.nikhef.pdp.dynsched-pbs-plugin/trunk/torqueJobs.py

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

revision 2329 by templon, Wed Jul 6 15:12:07 2011 UTC revision 2330 by templon, Thu Jul 7 08:32:04 2011 UTC
# Line 7  Line 7 
7  #--  #--
8    
9  # logFileRecordParser : parse a line from a torque accounting file  # logFileRecordParser : parse a line from a torque accounting file
 #  
 # mapatts : map torque specific attribute names to more generic ones, as well as convert times into seconds  
 #           and memory usage into megabytes  
10    
11  # function logFileRecordParser  # function logFileRecordParser
12  # input  : a line from a PBS accounting file  # input  : a line from a PBS accounting file
# Line 74  def logFileRecordParser(record,debug=Non Line 71  def logFileRecordParser(record,debug=Non
71    
72      return (r_timestamp, r_type, r_jobid, r_attrs)      return (r_timestamp, r_type, r_jobid, r_attrs)
73    
74  ## following is helper for class Event.  ## following takes as arg a list of key=val pairs, returns a dict with the same
 ## takes as arg a list of key=val pairs, returns a dict with the same  
75  ## structure.  example input string:  ## structure.  example input string:
76  ## ['user=tdykstra', 'group=niktheorie', 'jobname=Q11_241828.gjob']  ## ['user=tdykstra', 'group=niktheorie', 'jobname=Q11_241828.gjob']
77    
# Line 172  def mapatts2(indict): Line 168  def mapatts2(indict):
168              odict[k] = indict[k]              odict[k] = indict[k]
169      return odict      return odict
170    
171  def qs_parsejob(instring, mapper=mapatts2):  def qs_parsejob(instring, mapper=None):
172      # function for parsing a block of text corresponding to a single job.      # function for parsing a block of text corresponding to a single job.
173      # optional mapper function can be used to change what is returned, for example rename attributes      # optional mapper function can be used to change what is returned, for example rename attributes
174      # or convert units of the values.      # or convert units of the values.

Legend:
Removed from v.2329  
changed lines
  Added in v.2330

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