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 nativeRun(benchmark, n, input): PARSEC_HOME = util.findParsecInstall() script = """ $PARSEC_HOME/bin/parsecmgmt -a run -p {0} -c llvm -n {1} -i {2} -s "/usr/bin/time" """ script = script.format(benchmark, n, input) jobName = "llvm_{}_{}_{}".format(input, n, benchmark) print jobName return util.quicksub(name=jobName, code=script, resources=["nodes=1:ppn=24"], queue="newpasta")
def nativeRunParsec(benchmark, n, input, timeC): PARSEC_HOME = util.findParsecInstall() script = """ mkdir /tmp/$USER $PARSEC_HOME/bin/parsecmgmt -a run -p {0} -c llvm -d /tmp/$USER -n {1} -i {2} -s "{3}" """ script = script.format(benchmark, n, input, timeC) return script
def nativeRunNas(benchmark, n, input, timeC): PARSEC_HOME = util.findParsecInstall() script = """ mkdir /tmp/$USER cp $NAS_HOME/bin-llvm/{0}.{2}.x /tmp/$USER cd /tmp/$USER setenv OMP_NUM_THREADS {1} {3} /tmp/$USER/{0}.{2}.x cd - rm -f /tmp/$USER/* """ script = script.format(benchmark, n, input, timeC) return script
def nativeRun(benchmark, n, input): PARSEC_HOME = util.findParsecInstall() script = """ mkdir /tmp/$USER cp $NAS_HOME/bin-llvm/{0}.{2}.x /tmp/$USER cd /tmp/$USER setenv OMP_NUM_THREADS {1} /usr/bin/time /tmp/$USER/{0}.{2}.x cd - rm -f /tmp/$USER/* """ script = script.format(benchmark, n, input) jobName = "llvm_{}_{}_{}".format(input, n, benchmark) print jobName return util.quicksub(name=jobName, code=script, resources=["nodes=1:ppn=24"], queue="newpasta")
def nativeRun(benchmark, n, input): PARSEC_HOME = util.findParsecInstall() script = """ mkdir /tmp/$USER cp $NAS_HOME/bin-llvm/{0}.{2}.x /tmp/$USER cd /tmp/$USER setenv OMP_NUM_THREADS {1} /usr/bin/time /tmp/$USER/{0}.{2}.x cd - rm -f /tmp/$USER/* """ script = script.format(benchmark, n, input) jobName = "llvm_{}_{}_{}".format(input, n, benchmark) print jobName return util.quicksub(name=jobName, code=script, resources=["nodes=1:ppn=24,pmem=1gb"], 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)