47 JOBNUMBER, JOBDIR, JOBID, JOBSTATUS, JOBNTRY, JOBRUNTIME, JOBNEVT, JOBHOST, JOBINCR, \
48 JOBREMARK, JOBSP1, JOBSP2, JOBSP3 = ([]
for i
in range(13))
50 header, batchScript, cfgTemplate, infiList, classInf, addFiles, driver, mergeScript, \
51 mssDir, updateTimeHuman, mssDirPool, spare1, spare2, spare3 = (
'' for i
in range(14))
53 updateTime, elapsedTime, pedeMem , nJobs = -1, -1, -1, -1
58 DBFILE = open(
'mps.db',
'r')
61 self.
header = DBFILE.readline().strip()
67 self.
driver = DBFILE.readline().rstrip(
'\n')
69 self.
mssDir = DBFILE.readline().rstrip(
'\n')
75 self.
spare1 = DBFILE.readline().rstrip(
'\n')
76 self.
spare2 = DBFILE.readline().rstrip(
'\n')
77 self.
spare3 = DBFILE.readline().rstrip(
'\n')
85 line = line.rstrip(
'\n')
86 parts = line.split(
":")
87 self.JOBNUMBER.append(int(parts[0]))
88 self.JOBDIR.append(parts[1])
89 self.JOBID.append(int(parts[2]))
90 self.JOBSTATUS.append(parts[3])
91 self.JOBNTRY.append(int(parts[4]))
92 self.JOBRUNTIME.append(int(parts[5]))
93 self.JOBNEVT.append(int(parts[6]))
94 self.JOBHOST.append(parts[7])
95 self.JOBINCR.append(int(parts[8]))
96 self.JOBREMARK.append(parts[9])
97 self.JOBSP1.append(parts[10])
98 self.JOBSP2.append(parts[11])
99 self.JOBSP3.append(parts[12])
102 if 'jobm' not in self.JOBDIR[self.
nJobs]:
105 self.
nJobs = milleJobs
115 print "\n=== mps database printout ===\n"
122 print 'driver:\t\t', self.
driver
124 print 'mssDir:\t\t', self.
mssDir
128 print 'pedeMem:\t', self.
pedeMem,
'\n'
131 print '### dir jobid stat try rtime nevt remark weight name'
132 print "------------------------------------------------------------------------------"
133 for i
in xrange(self.
nJobs):
134 print '%03d %6s %9d %6s %3d %5d %8d %8s %5s %s' % (
147 if self.
driver ==
'merge':
148 for i
in xrange(self.
nJobs,len(self.JOBDIR)):
149 print '%s %6s %9d %6s %3d %5d %8d %8s %5s %s' % (
162 totalEvents = sum(self.JOBNEVT[:self.
nJobs])
163 totalCpu = sum(self.JOBRUNTIME[:self.
nJobs])
166 meanCpuPerEvent = float(totalCpu)/totalEvents
167 print "------------------------------------------------------------------------------"
168 print "\t\t\t\t\tEvent total:\t", totalEvents
169 print "\t\t\t\t\tCPU total:\t", totalCpu,
's'
170 print "\t\t\t\t\tMean CPU/event:\t",meanCpuPerEvent,
's'
179 self.
header =
"mps database schema 3.2"
186 self.
spare1 =
"-- unused --"
187 self.
spare2 =
"-- unused --"
188 self.
spare3 =
"-- unused --"
191 os.system(
'[[ -a mps.db ]] && cp -p mps.db mps.db~')
194 DBFILE = open (
"mps.db",
"w")
200 for item
in headData:
201 DBFILE.write(
"%s\n" % item)
204 for i
in xrange(len(self.JOBID)):
205 DBFILE.write(
'%03d:%s:%05d:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n' %
225 CLASSES = self.classInf.split(
':')
226 if len(CLASSES)<1
or len(CLASSES)>2:
227 print '\nget_class():\n class must be of the form \'class\' or \'classMille:classPede\', but is \'%s\'!\n\n', classInf
230 elif argument ==
'mille':
232 elif argument ==
'pede':
233 if len(CLASSES) == 1:
235 elif len(CLASSES) == 2:
238 print '\nget_class():\n Know class only for \'mille\' or \'pede\', not %s!\n\n' %argument