def computeallcpus(self):
""" overall stats for all cores on the nodes """
ratios = numpy.empty((self._ncpumetrics, self._totalcores), numpy.double)
coreindex = 0
for host, last in self._last.iteritems():
try:
elapsed = last - self._first[host]
if numpy.amin(numpy.sum(elapsed, 0)) < 1.0:
# typically happens if the job was very short and the datapoints are too close together
return {"error": ProcessingError.JOB_TOO_SHORT}
coresperhost = len(last[0, :])
ratios[:, coreindex:(coreindex+coresperhost)] = 1.0 * elapsed / numpy.sum(elapsed, 0)
coreindex += coresperhost
except ValueError:
# typically happens if the linux pmda crashes during the job
return {"error": ProcessingError.INSUFFICIENT_DATA}
results = {}
for i, name in enumerate(self._outnames):
results[name] = calculate_stats(ratios[i, :])
results['all'] = {"cnt": self._totalcores}
return results
评论列表
文章目录