def run(self, phased=False):
        counters = [
            'inst_retired.any', 'instructions', 'mem_inst_retired.all_loads',
            'mem_inst_retired.all_stores', 'L1-dcache-loads',
            'L1-dcache-stores', 'LLC-load-misses', 'LLC-store-misses',
            'cycles', 'fp_arith_inst_retired.128b_packed_double',
            'fp_arith_inst_retired.128b_packed_single',
            'fp_arith_inst_retired.256b_packed_double',
            'fp_arith_inst_retired.256b_packed_single'
        ]

        for prereq in self.prereqs:
            self.logger.info("Running prereq %s" % prereq)
            run_command(prereq.split(), self.logger)

        for task in self.commands:
            name = task["name"]
            command = task["command"]
            self.logger.info("Running command %s" % name)
            p = Perf()
            p.set_command(command)
            p.set_counters(counters)
            p.set_repeat_factor(1)
            if phased:
                result = p.run_phased()
                for res in result:
                    res["name"] = name
                self.data.extend(result)
            else:
                result = p.run()
                if result is not None:
                    result["name"] = name
                self.data.append(result)
Esempio n. 2
0
    def __init__(self, cols):
        self._rows = []
        self.logger = logging.Logger.manager.getLogger(self.__class__.__name__)
        #self.prio_rows = {}
        self.cols = cols

        self._passes = 0  # perf counter to see how many tests we do on a given table
        self.perf = Perf(self.logger)
Esempio n. 3
0
    def optimize(self, nIter):
        if self._t is None:
            self._t0 = time.time()
            self._t = self._t0

        pAsk = Perf()
        pTell = Perf()
        pPhi = MultiPerf()
        for _ in range(nIter):
            pAsk.start()
            ws = np.array(self._es.ask())
            pAsk.stop()
            phis = self._phi(pPhi, ws)
            pTell.start()
            self._es.tell(phis)
            pTell.stop()

            self._iReport += 1
            if self._iReport == self._nReport:
                t = time.time()
                print(
                    "EVAL: iter = %d t = %.2f dt = %.4f phi = %.4e wmn = %.4f wmx = %.4f sigma = %.4e nEvalsPerW = %d"
                    % (self._nIter, t - self._t0, t - self._t, phis.mean(),
                       ws.mean(), np.abs(ws).max(), self._es.getSigma(),
                       self._nEvalsThisTime))
                self._phiLatest = phis.mean()

                perf = self._collectPerf()
                print("PERF: pA = %.3f pT = %.3f pP = %s %s" %
                      (1000 * pAsk.mean(), 1000 * pTell.mean(), ' '.join(
                          ["%.3f" % (1000 * p) for p in pPhi.means()]), perf))
                self._t = t
                self._nIter += 1
                self._trace.append(phis.mean())
                self._iReport = 0

        self._wfav = np.array(self._es.getXFavorite())
        self._bbo.setParams(self._wfav)
Esempio n. 4
0
    def reset(self):
        # This ensures that the traffic arrays (which size is dynamic)
        # are all reset as well, so all lat,lon,sdp etc but also objects adsb
        super(Traffic, self).reset()
        self.ntraf = 0

        # Reset models
        self.wind.clear()

        # Build new modules for area and turbulence
        self.area       = Area()
        self.Turbulence = Turbulence()

        # Noise (turbulence, ADBS-transmission noise, ADSB-truncated effect)
        self.setNoise(False)

        # Default: BlueSky internal performance model.
        # Insert your BADA files to the folder "BlueSky/data/coefficients/BADA"
        # for working with EUROCONTROL`s Base of Aircraft Data revision 3.12
        self.perf    = Perf()
        self.trails.reset()
Esempio n. 5
0
from logger import create_logger

if __name__ == "__main__":
    logger = create_logger()
    cmd = "/home/prathyushpv/work/cpu2017/bin/runcpu --config=config1.cfg --threads 1 "
    benchmarks = [
        '607.cactuBSSN_s'
        '619.lbm_s', '621.wrf_s', '627.cam4_s', '628.pop2_s', '638.imagick_s',
        '644.nab_s', '649.fotonik3d_s', '654.roms_s'
    ]
    counters = [
        'LLC-load-misses', 'LLC-store-misses', 'instructions',
        'L1-dcache-loads', 'L1-dcache-stores'
    ]
    for benchmark in benchmarks:
        p = Perf(counters, cmd + benchmark)
        result = p.run_continuous()
        size = min([len(counter_values) for counter_values in result.values()])
        y_mem = [(result["LLC-load-misses"][i] + result["LLC-store-misses"][i])
                 for i in range(size)]
        y_cpu = [(result["instructions"][i] - result["L1-dcache-loads"][i] -
                  result["L1-dcache-stores"][i]) / 1000 for i in range(size)]
        x = range(size)

        print(y_mem)
        print(y_cpu)
        fig = plt.figure()

        ax = fig.add_subplot(
            1,
            1,