1# Copyright (c) 2005-2006 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 15 unchanged lines hidden (view full) --- 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Nathan Binkert 28 29from chart import ChartOptions 30 31class StatOutput(ChartOptions): |
32 def __init__(self, jobfile, info, stat=None): |
33 super(StatOutput, self).__init__() 34 self.jobfile = jobfile 35 self.stat = stat |
36 self.invert = False 37 self.info = info 38 |
39 def display(self, name, printmode = 'G'): |
40 import info 41 |
42 if printmode == 'G': 43 valformat = '%g' 44 elif printmode != 'F' and value > 1e6: 45 valformat = '%0.5e' 46 else: 47 valformat = '%f' 48 49 for job in self.jobfile.jobs(): --- 7 unchanged lines hidden (view full) --- 57 if self.invert: 58 for i,val in enumerate(value): 59 if val != 0.0: 60 value[i] = 1 / val 61 62 valstring = ', '.join([ valformat % val for val in value ]) 63 print '%-50s %s' % (job.name + ':', valstring) 64 |
65 def graph(self, name, graphdir, proxy=None): 66 from os.path import expanduser, isdir, join as joinpath 67 from barchart import BarChart 68 from matplotlib.numerix import Float, array, zeros 69 import os, re, urllib 70 from jobfile import crossproduct 71 72 confgroups = self.jobfile.groups() --- 141 unchanged lines hidden --- |