def main(): CONTECH_HOME = util.findContechInstall() script = """ #!/bin/csh cd /net/tinker/brailing/contech/scripts ./build{3}.py {0} ./run{3}.py --traceOnly --discardTrace {0} -n 16 -i {2} --time "{1}" ./run{3}.py --traceOnly --discardTrace {0} -n 16 -i {2} --time "{1}" --pinFrontend {4} """ bset = util.Benchmarks.all timeCmd = "perf stat -x, -e L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,L1-dcache-store-misses,branches,branch-misses,L1-icache-loads,L1-icache-load-misses,instructions,cycles" #timeCmd = "perf stat -x, -e LLC-loads,LLC-load-misses,LLC-stores,LLC-store-misses,bus-cycles,ref-cycles,stalled-cycles-frontend,stalled-cycles-backend" # for b in util.Benchmarks.nas: # util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, timeCmd, "A", "_nas", nativeRunNas(b, 16, "A", time)), resources=["nodes=1:ppn=24,pmem=1gb"], queue="newpasta") # time.sleep(30) for b in bset: util.quicksub(name="{}_{}".format(b, "perf"), code=script.format( b, timeCmd, "simsmall", "_parsec", nativeRunParsec(b, 16, "simmedium", timeCmd)), resources=["nodes=1:ppn=24,pmem=1gb"], queue="newpasta") time.sleep(1)
def main(): CONTECH_HOME = util.findContechInstall() CONTECH_WRAPPER = os.path.join(CONTECH_HOME, "scripts/contech_wrapper.py") CONTECH_MARKER = os.path.join(CONTECH_HOME, "scripts/contech_marker.py") stateFile = os.path.join(CONTECH_HOME, "scripts/output/contechStateFile.temp") OBJPARSE = os.path.join(CONTECH_HOME, "scripts/objparse.py") RUN = os.path.join(CONTECH_HOME, "scripts/run.py") parser = argparse.ArgumentParser(description='Generates a task graph with a matching marked object file for a parsec benchmark') parser.add_argument('benchmark', help='The simple benchmark to build.') args = parser.parse_args() # Reset state file if os.path.exists(stateFile): os.remove(stateFile) # Marker run pcall([CONTECH_MARKER, args.benchmark + ".c", "-o", args.benchmark, "-lpthread", "-O3"]) # Objparse markedObjectFile = os.path.join(CONTECH_HOME, "middle/output/" + os.path.basename(args.benchmark) + ".mo") pcall([OBJPARSE, args.benchmark, markedObjectFile]) # Reset state file os.remove(stateFile) # Actual build pcall([CONTECH_WRAPPER, args.benchmark + ".c", "-o", args.benchmark, "-lpthread", "-O3"]) # Generate taskgraph pcall([RUN, args.benchmark])
def statsRun(benchmark, n, input, option): CONTECH_HOME = util.findContechInstall() if os.environ.has_key("CONTECH_OUTDIR"): script = """ cd $CONTECH_HOME/scripts ./run_nas.py {0} -n {1} -i {2} {3} --backends stats rm -f --verbose $CONTECH_OUTDIR/{0}.contech.trace rm -f --verbose $CONTECH_OUTDIR/{0}.taskgraph; """ else: script = """ cd $CONTECH_HOME/scripts ./run_nas.py {0} -n {1} -i {2} {3} --backends stats rm -f --verbose /tmp/{0}.contech.trace rm -f --verbose /tmp/{0}.taskgraph; """ options = { "discard": "--discardTrace", "pin": "--pinFrontend", "contech": "", "contechmarker": "" } script = script.format(benchmark, n, input, options[option]) jobName = "{}_{}_{}_{}".format(option, input, n, benchmark) print jobName return util.quicksub(name=jobName, code=script, resources=["nodes=1:ppn=24,pmem=1gb"], queue="newpasta")
def statsRun(benchmark, n, input, option): CONTECH_HOME = util.findContechInstall() if os.environ.has_key("CONTECH_OUTDIR"): script = """ cd $CONTECH_HOME/scripts ./run_parsec.py {0} -n {1} -i {2} {3} --backends stats rm -f --verbose $CONTECH_OUTDIR/{0}.contech.trace rm -f --verbose $CONTECH_OUTDIR/{0}.taskgraph; """ else: script = """ cd $CONTECH_HOME/scripts ./run_parsec.py {0} -n {1} -i {2} {3} --backends stats rm -f --verbose /tmp/{0}.contech.trace rm -f --verbose /tmp/{0}.taskgraph; """ options = {"discard": "--discardTrace", "pin" : "--pinFrontend", "contech" : "", "contechmarker" : ""} script = script.format(benchmark, n, input, options[option]) jobName = "{}_{}_{}_{}".format(option, input, n, benchmark) print jobName return util.quicksub(name=jobName, code=script, resources=["nodes=1:ppn=24,pmem=1800mb"], queue="newpasta")
def buildLocal(benchmark): CONTECH_HOME = util.findContechInstall() os.chdir(os.path.join(CONTECH_HOME, "scripts")) try: util.pcall(["./build_parsec.py {0}".format(benchmark)]) except: pass
def main(): CONTECH_HOME = util.findContechInstall() OBJPARSE = os.path.join(CONTECH_HOME, "scripts/objparse.py") PARSEC_HOME = util.findParsecInstall() PARSECMGMT = os.path.join(PARSEC_HOME, "bin/parsecmgmt") parser = argparse.ArgumentParser(description='Generates a marked object file (.mo) for a parsec benchmark') parser.add_argument('benchmark', help='The parsec benchmark.') args = parser.parse_args() stateFile = os.path.join(CONTECH_HOME, "scripts/output/", args.benchmark + ".stateFile.temp") os.environ["CONTECH_STATE_FILE"] = stateFile # Run the parsec benchmark print ">Building " + args.benchmark # Prepare state file for run if os.path.exists(stateFile): os.remove(stateFile) pcall([PARSECMGMT, "-a", "uninstall", "-p", args.benchmark, "-c", "contech_marker"]) pcall([PARSECMGMT, "-a", "build", "-p", args.benchmark, "-c", "contech_marker"]) # Find the executable generated by the build exe = os.path.join(PARSEC_HOME, "pkgs/apps/" + args.benchmark + "/inst/amd64-linux.contech_marker/bin/" + args.benchmark) # Parse the code to generate a marked object file markedObjectFile = os.path.join(CONTECH_HOME, "middle/output/" + args.benchmark + ".mo") pcall([OBJPARSE, exe, markedObjectFile]) # Clean up os.remove(stateFile)
def mark(benchmark): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts ./mark_parsec.py {0} """ script = script.format(benchmark) return util.quicksub(name=("mark_" + benchmark), code=script)
def build(benchmark, bldconf="contech"): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts ./build_parsec.py {0} --bldconf {1} """ script = script.format(benchmark, bldconf) return util.quicksub(name=("build_" + benchmark), code=script)
def launchBackend(backend): CONTECH_HOME = util.findContechInstall() script = """ cd /net/tinker/brailing/contech/scripts ./run{3}.py --cached {0} -n 16 -i {2} --backend {1} """ bset = util.Benchmarks.all for b in util.Benchmarks.nas: util.quicksub(name="{}_{}".format(b, backend), code=script.format(b, backend, "A", "_nas"), resources=["nodes=1:ppn=24"], queue="newpasta") for b in bset: util.quicksub(name="{}_{}".format(b, backend), code=script.format(b, backend, "simmedium", "_parsec"), resources=["nodes=1:ppn=24"], queue="newpasta")
def main(): CONTECH_HOME = util.findContechInstall() script = """ cd /net/tinker/brailing/contech/scripts ./build{3}.py {0} ./run{3}.py --traceOnly --discardTrace {0} -n 16 -i {2} --time "{1}" ./run{3}.py --traceOnly --discardTrace {0} -n 16 -i {2} --time "{1}" --pinFrontend {4} """ bset = util.Benchmarks.all time = "perf stat -x, -e L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,L1-dcache-store-misses,branches,branch-misses,L1-icache-loads,L1-icache-load-misses,instructions,cycles" for b in bset: util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, time, "simmedium", "_parsec",nativeRunParsec(b, 16, "simmedium", time)), resources=["nodes=1:ppn=24"], queue="newpasta") for b in util.Benchmarks.nas: util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, time, "A", "_nas", nativeRunNas(b, 16, "A", time)), resources=["nodes=1:ppn=24"], queue="newpasta")
def compilationTimeCompare(benchmark): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts """ test = """ # {0} ./build_parsec.py {0} --bldconf llvm | {1} ./build_parsec.py {0} --bldconf contech | {2} """ label = "sed s/'Build'/'{0}'/ " script += test.format(benchmark, label.format(benchmark+"-llvm"), label.format(benchmark+"-contech")) # print script return util.quicksub(name="timed_compilation_{}".format(benchmark), code=script, resources=["nodes=1:ppn=1,pmem=1gb"], queue="newpasta")
def compilationTimeCompare(benchmark, input): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts """ test = """ # {0} ./build_nas.py {0} -i {3} -c llvm | {1} ./build_nas.py {0} -i {3} -c contech | {2} """ label = "sed s/'Build'/'{0}'/ " script += test.format(benchmark, label.format(benchmark+"-llvm"), label.format(benchmark+"-contech"), input) # print script return util.quicksub(name="timed_compilation_{}".format(benchmark), code=script, queue="newpasta")
def main(): CONTECH_HOME = util.findContechInstall() CONTECH_WRAPPER = os.path.join(CONTECH_HOME, "scripts/contech_wrapper.py") CONTECH_MARKER = os.path.join(CONTECH_HOME, "scripts/contech_marker.py") stateFile = os.path.join(CONTECH_HOME, "scripts/output/contechStateFile.temp") OBJPARSE = os.path.join(CONTECH_HOME, "scripts/objparse.py") RUN = os.path.join(CONTECH_HOME, "scripts/run.py") parser = argparse.ArgumentParser( description= 'Generates a task graph with a matching marked object file for a parsec benchmark' ) parser.add_argument('benchmark', help='The simple benchmark to build.') args = parser.parse_args() # Reset state file if os.path.exists(stateFile): os.remove(stateFile) # Marker run pcall([ CONTECH_MARKER, args.benchmark + ".c", "-o", args.benchmark, "-lpthread", "-O3" ]) # Objparse markedObjectFile = os.path.join( CONTECH_HOME, "middle/output/" + os.path.basename(args.benchmark) + ".mo") pcall([OBJPARSE, args.benchmark, markedObjectFile]) # Reset state file os.remove(stateFile) # Actual build pcall([ CONTECH_WRAPPER, args.benchmark + ".c", "-o", args.benchmark, "-lpthread", "-O3" ]) # Generate taskgraph pcall([RUN, args.benchmark])
def compilationTimeCompare(benchmark, input): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts """ test = """ # {0} ./build_nas.py {0} -i {3} -c llvm | {1} ./build_nas.py {0} -i {3} -c contech | {2} """ label = "sed s/'Build'/'{0}'/ " script += test.format(benchmark, label.format(benchmark + "-llvm"), label.format(benchmark + "-contech"), input) # print script return util.quicksub(name="timed_compilation_{}".format(benchmark), code=script, queue="newpasta")
def main(): CONTECH_HOME = util.findContechInstall() OBJPARSE = os.path.join(CONTECH_HOME, "scripts/objparse.py") PARSEC_HOME = util.findParsecInstall() PARSECMGMT = os.path.join(PARSEC_HOME, "bin/parsecmgmt") parser = argparse.ArgumentParser( description= 'Generates a marked object file (.mo) for a parsec benchmark') parser.add_argument('benchmark', help='The parsec benchmark.') args = parser.parse_args() stateFile = os.path.join(CONTECH_HOME, "scripts/output/", args.benchmark + ".stateFile.temp") os.environ["CONTECH_STATE_FILE"] = stateFile # Run the parsec benchmark print ">Building " + args.benchmark # Prepare state file for run if os.path.exists(stateFile): os.remove(stateFile) pcall([ PARSECMGMT, "-a", "uninstall", "-p", args.benchmark, "-c", "contech_marker" ]) pcall([ PARSECMGMT, "-a", "build", "-p", args.benchmark, "-c", "contech_marker" ]) # Find the executable generated by the build exe = os.path.join( PARSEC_HOME, "pkgs/apps/" + args.benchmark + "/inst/amd64-linux.contech_marker/bin/" + args.benchmark) # Parse the code to generate a marked object file markedObjectFile = os.path.join(CONTECH_HOME, "middle/output/" + args.benchmark + ".mo") pcall([OBJPARSE, exe, markedObjectFile]) # Clean up os.remove(stateFile)
def compilationTimeCompare(benchmark): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts """ test = """ # {0} ./build_parsec.py {0} --bldconf llvm | {1} ./build_parsec.py {0} --bldconf contech | {2} """ label = "sed s/'Build'/'{0}'/ " script += test.format(benchmark, label.format(benchmark + "-llvm"), label.format(benchmark + "-contech")) # print script return util.quicklocal(name="timed_compilation_{}".format(benchmark), code=script, resources=["nodes=1:ppn=1,pmem=1gb"], queue="newpasta")
def main(): CONTECH_HOME = util.findContechInstall() script = """ #!/bin/csh cd /net/tinker/brailing/contech/scripts ./build{3}.py {0} ./run{3}.py --traceOnly --discardTrace {0} -n 16 -i {2} --time "{1}" ./run{3}.py --traceOnly --discardTrace {0} -n 16 -i {2} --time "{1}" --pinFrontend {4} """ bset = util.Benchmarks.all timeCmd = "perf stat -x, -e L1-dcache-loads,L1-dcache-load-misses,L1-dcache-stores,L1-dcache-store-misses,branches,branch-misses,L1-icache-loads,L1-icache-load-misses,instructions,cycles" #timeCmd = "perf stat -x, -e LLC-loads,LLC-load-misses,LLC-stores,LLC-store-misses,bus-cycles,ref-cycles,stalled-cycles-frontend,stalled-cycles-backend" # for b in util.Benchmarks.nas: # util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, timeCmd, "A", "_nas", nativeRunNas(b, 16, "A", time)), resources=["nodes=1:ppn=24,pmem=1gb"], queue="newpasta") # time.sleep(30) for b in bset: util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, timeCmd, "simsmall", "_parsec",nativeRunParsec(b, 16, "simmedium", timeCmd)), resources=["nodes=1:ppn=24,pmem=1gb"], queue="newpasta") time.sleep(1)
def main(): CONTECH_HOME = util.findContechInstall() script = """ cd /net/tinker/brailing/contech/scripts ./build{3}.py {0} ./run{3}.py --traceOnly {0} -n 16 -i {2} --time "{1}" """ bset = util.Benchmarks.all time = "/usr/bin/time" for b in bset: util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, time, "simmedium", "_parsec"), resources=["nodes=1:ppn=24"], queue="newpasta") for b in util.Benchmarks.nas: util.quicksub(name="{}_{}".format(b, "perf"), code=script.format(b, time, "A", "_nas"), resources=["nodes=1:ppn=24"], queue="newpasta")
def compilationTimeCompare(benchmarks): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts """ # extract = """grep "Build finished in" | sed s/'Build finished in'/{{\"{0}\":/ | sed s/seconds/}}/""" label = "sed s/'Build'/'{0}'/ " for benchmark in benchmarks: test = """ # {0} ./build_parsec.py {0} --bldconf llvm | {1} ./build_parsec.py {0} --bldconf contech | {2} """ script += test.format(benchmark, label.format(benchmark+"-llvm"), label.format(benchmark+"-contech")) # print script return util.quicksub(name=("timed_compilation"), code=script)
def compilationTimeCompare(benchmarks): CONTECH_HOME = util.findContechInstall() script = """ cd $CONTECH_HOME/scripts """ # extract = """grep "Build finished in" | sed s/'Build finished in'/{{\"{0}\":/ | sed s/seconds/}}/""" label = "sed s/'Build'/'{0}'/ " for benchmark in benchmarks: test = """ # {0} ./build_parsec.py {0} --bldconf llvm | {1} ./build_parsec.py {0} --bldconf contech | {2} """ script += test.format(benchmark, label.format(benchmark + "-llvm"), label.format(benchmark + "-contech")) # print script return util.quicksub(name=("timed_compilation"), code=script)
def main(): CONTECH_HOME = util.findContechInstall() script = """ cd /net/tinker/brailing/contech/scripts ./build{3}.py {0} ./run{3}.py --traceOnly {0} -n 16 -i {2} --time "{1}" """ bset = util.Benchmarks.all time = "/usr/bin/time" for b in bset: util.quicksub( name="{}_{}".format(b, "perf"), code=script.format(b, time, "simmedium", "_parsec"), resources=["nodes=1:ppn=24"], queue="newpasta", ) for b in util.Benchmarks.nas: util.quicksub( name="{}_{}".format(b, "perf"), code=script.format(b, time, "A", "_nas"), resources=["nodes=1:ppn=24"], queue="newpasta", )