コード例 #1
0
ファイル: papi.py プロジェクト: simbuerg/benchbuild
    def actions_for_project(self, p):
        """
        Create & Run a papi-instrumented version of the project.

        This experiment uses the -jitable flag of libPolyJIT to generate
        dynamic SCoP coverage.
        """
        p.ldflags = p.ldflags + ["-lpjit", "-lpprof", "-lpapi"]
        p.cflags = [
            "-O3", "-Xclang", "-load", "-Xclang", "LLVMPolyJIT.so", "-mllvm",
            "-polli", "-mllvm", "-jitable", "-mllvm", "-instrument", "-mllvm",
            "-no-recompilation", "-mllvm", "-polly-detect-keep-going"
        ]
        p.compiler_extension = partial(collect_compilestats, p, self)
        p.runtime_extension = partial(run_with_time, p, self, CFG, 1)

        def evaluate_calibration(e):
            from benchbuild.utils.cmd import pprof_calibrate
            papi_calibration = e.get_papi_calibration(p, pprof_calibrate)
            e.persist_calibration(p, pprof_calibrate, papi_calibration)

        actns = [
            MakeBuildDir(p),
            Echo("{0}: Compiling... {1}".format(self.name, p.name)),
            Prepare(p),
            Download(p),
            Configure(p),
            Build(p),
            Echo("{0}: Running... {1}".format(self.name, p.name)),
            Run(p),
            Clean(p),
            Echo("{0}: Calibrating... {1}".format(self.name, p.name)),
            Step(p, action_fn=partial(evaluate_calibration, self))
        ]
        return actns
コード例 #2
0
ファイル: pjtest.py プロジェクト: simbuerg/benchbuild
    def actions_for_project(self, p):
        from benchbuild.settings import CFG

        p = PolyJIT.init_project(p)

        actns = []
        p.run_uuid = uuid.uuid4()
        jobs = int(CFG["jobs"].value())
        p.cflags += [
            "-Rpass-missed=polli*", "-mllvm", "-stats", "-mllvm",
            "-polly-num-threads={0}".format(jobs)
        ]
        p.runtime_extension = partial(time_polyjit_and_polly, p, self, CFG,
                                      jobs)

        actns.extend([
            MakeBuildDir(p),
            Prepare(p),
            Download(p),
            Configure(p),
            Build(p),
            Run(p),
            Clean(p)
        ])
        return actns
コード例 #3
0
ファイル: empty.py プロジェクト: vulder/benchbuild
 def actions_for_project(self, project):
     """ Do nothing. """
     return [
         MakeBuildDir(project),
         Download(project),
         Configure(project),
         Clean(project)
     ]
コード例 #4
0
ファイル: experiment.py プロジェクト: vulder/benchbuild
 def default_compiletime_actions(project):
     """Return a series of actions for a compile time experiment."""
     return [
         MakeBuildDir(project),
         Prepare(project),
         Download(project),
         Configure(project),
         Build(project),
         Clean(project)
     ]
コード例 #5
0
ファイル: test_run.py プロジェクト: simbuerg/benchbuild
 def actions_for_project(self, project):
     from benchbuild.utils.actions import (
         Prepare, Download, Configure, Build, Run, Clean)
     inside = None
     actns = []
     project.builddir = "/tmp/throwaway"
     actns = [Prepare(project),
              Download(project),
              Configure(project),
              Build(project),
              Run(project),
              Clean(project)]
     return actns
コード例 #6
0
    def actions_for_project(self, p):
        from benchbuild.settings import CFG

        p.compiler_extension = partial(collect_compilestats, p, self, CFG)

        actns = [
            MakeBuildDir(p),
            Echo("{}: Configure...".format(self.name)),
            Prepare(p),
            Download(p),
            Configure(p),
            Echo("{}: Building...".format(self.name)),
            Build(p),
            Clean(p)
        ]
        return actns
コード例 #7
0
 def actions_for_project(self, project):
     """Compile & Run the experiment with -O3 enabled."""
     project.cflags = ["-O3", "-fno-omit-frame-pointer"]
     project.runtime_extension = \
         partial(run_with_time, project, self, CFG, CFG["jobs"].value())
     actns = [
         MakeBuildDir(project),
         Echo("Compiling... {}".format(project.name)),
         Prepare(project),
         Download(project),
         Configure(project),
         Build(project),
         Echo("Running... {}".format(project.name)),
         Run(project),
         Clean(project),
     ]
     return actns
コード例 #8
0
    def actions_for_project(self, project):
        configs = CFG["perf"]["config"].value()
        if configs is None:
            warnings.warn("({0}) should not be null.".format(
                repr(CFG["perf"]["config"])),
                          category=ShouldNotBeNone,
                          stacklevel=2)
            return

        config_list = re.split(r'\s*', configs)

        config_with_llvm = []
        for config in config_list:
            config_with_llvm.append("-mllvm")
            config_with_llvm.append(config)

        project.cflags = [
            "-O3", "-fno-omit-frame-pointer", "-Xclang", "-load", "-Xclang",
            "LLVMPolyJIT.so", "-mllvm", "-polly"
        ] + config_with_llvm

        actns = []
        jobs = CFG["jobs"].value()
        for i in range(1, int(jobs)):
            cp = copy.deepcopy(project)
            cp.run_uuid = uuid.uuid4()

            cp.cflags += ["-mllvm", "-polly-num-threads={0}".format(i)]
            cp.runtime_extension = functools.partial(run_with_time, cp, self,
                                                     CFG, i)

            actns.extend([
                MakeBuildDir(cp),
                Echo("{0} core configuration. Configure & Compile".format(i)),
                Prepare(cp),
                Download(cp),
                Configure(cp),
                Build(cp),
                Echo("{0} core configuration. Run".format(i)),
                Run(cp),
                Clean(cp)
            ])
        return actns
コード例 #9
0
ファイル: vectorize.py プロジェクト: simbuerg/benchbuild
 def actions_for_project(self, project):
     """Compile & Run the experiment with -O3 enabled."""
     project.cflags = [
         "-O3", "-fno-omit-frame-pointer", "-Xclang", "-load", "-Xclang",
         "LLVMPolyJIT.so", "-mllvm", "-polly", "-mllvm",
         "-polly-vectorizer=stripmine"
     ]
     project.runtime_extension = functools.partial(run_with_time, project,
                                                   self, CFG,
                                                   CFG["jobs"].value())
     actns = [
         MakeBuildDir(project),
         Echo("Compiling... {}".format(project.name)),
         Prepare(project),
         Download(project),
         Configure(project),
         Build(project),
         Echo("Running... {}".format(project.name)),
         Run(project),
         Clean(project),
     ]
     return actns
コード例 #10
0
ファイル: polyjit.py プロジェクト: simbuerg/benchbuild
    def actions_for_project(self, p):
        from benchbuild.settings import CFG

        p = PolyJIT.init_project(p)

        actns = []
        for i in range(2, int(str(CFG["jobs"])) + 1):
            cp = copy.deepcopy(p)
            cp.run_uuid = uuid.uuid4()
            cp.cflags += ["-mllvm", "-polly-num-threads={0}".format(i)]
            cp.runtime_extension = partial(run_with_time, cp, self, CFG, i)

            actns.extend([
                MakeBuildDir(cp),
                Echo("{0} core configuration. Configure & Compile".format(i)),
                Prepare(cp),
                Download(cp),
                Configure(cp),
                Build(cp),
                Echo("{0} core configuration. Run".format(i)),
                Run(cp),
                Clean(cp)
            ])
        return actns
コード例 #11
0
ファイル: polyjit.py プロジェクト: simbuerg/benchbuild
    def actions_for_project(self, p):
        from benchbuild.settings import CFG

        p.cflags = ["-O3", "-fno-omit-frame-pointer"]

        actns = []
        rawp = copy.deepcopy(p)
        rawp.run_uuid = uuid.uuid4()
        rawp.runtime_extension = partial(run_with_time, rawp, self, CFG, 1)

        actns.append(
            RequireAll([
                Echo("========= START: RAW Baseline"),
                MakeBuildDir(rawp),
                Prepare(rawp),
                Download(rawp),
                Configure(rawp),
                Build(rawp),
                Run(rawp),
                Clean(rawp),
                Echo("========= END: RAW Baseline")
            ]))

        jitp = copy.deepcopy(p)
        jitp = PolyJIT.init_project(jitp)
        norecomp = copy.deepcopy(jitp)
        norecomp.cflags += ["-mllvm", "-no-recompilation"]

        for i in range(2, int(str(CFG["jobs"])) + 1):
            cp = copy.deepcopy(norecomp)
            cp.run_uuid = uuid.uuid4()
            cp.runtime_extension = partial(run_without_recompile, cp, self,
                                           CFG, i)

            actns.append(
                RequireAll([
                    Echo("========= START: JIT No Recomp - Cores: {0}".format(
                        i)),
                    MakeBuildDir(cp),
                    Prepare(cp),
                    Download(cp),
                    Configure(cp),
                    Build(cp),
                    Run(cp),
                    Clean(cp),
                    Echo("========= END: JIT No Recomp - Cores: {0}".format(i))
                ]))

        for i in range(2, int(str(CFG["jobs"])) + 1):
            cp = copy.deepcopy(jitp)
            cp.run_uuid = uuid.uuid4()
            cp.runtime_extension = partial(run_with_time, cp, self, CFG, i)

            actns.append(
                RequireAll([
                    Echo("========= START: JIT - Cores: {0}".format(i)),
                    MakeBuildDir(cp),
                    Prepare(cp),
                    Download(cp),
                    Configure(cp),
                    Build(cp),
                    Run(cp),
                    Clean(cp),
                    Echo("========= END: JIT - Cores: {0}".format(i))
                ]))
        return [Any(actns)]