def base_perf(query, threads): filename = "{bin}/table_baseline__t_{t}.tex".format( bin=build_config.get_binary_path(), t=threads, q=query) print("Generating {}".format(filename)) with open(filename, "w") as f: cmd = "{bin}/print_perf_baseline.py --num_threads {t} -q {q}".format( bin=build_config.get_binary_path(), t=threads, q=query) print(cmd) p = subprocess.Popen(cmd, shell=True, stdout=f) p.wait()
def related_work(query, threads): filename = "{bin}/table_relatedwork__t_{t}.tex".format( bin=build_config.get_binary_path(), t=threads, q=query) print("Generating {}".format(filename)) with open(filename, "w") as f: cmd = "{bin}/print_related_work.py --num_threads {t}".format( bin=build_config.get_binary_path(), t=threads, q=query) print(cmd) p = subprocess.Popen(cmd, shell=True, stdout=f) p.wait()
def code_metrics(): filename = "{bin}/table_code_metrics.tex".format( bin=build_config.get_binary_path()) print("Generating {}".format(filename)) with open(filename, "w") as f: cmd = "{bin}/print_code_metrics.py".format( bin=build_config.get_binary_path()) print(cmd) p = subprocess.Popen(cmd, shell=True, stdout=f) p.wait()
def base_flavor(query, threads, scale): filename = "{bin}/table_base_flavor__q_{q}__t_{t}__s_{s}.tex".format( bin=build_config.get_binary_path(), t=threads, q=query, s=scale) print("Generating {}".format(filename)) with open(filename, "w") as f: cmd = "{bin}/print_base_flavors.py --limit 10 --color --latex --num_threads {t} -q {q} -s {scale}".format( bin=build_config.get_binary_path(), t=threads, q=query, scale=scale) print(cmd) p = subprocess.Popen(cmd, shell=True, stdout=f) p.wait()
def plot_pipeline_flavor(query, threads, scale): filename = "{bin}/plot_pipeline_flavor__q_{q}__t_{t}__sf_{scale}.pgf".format( bin=build_config.get_binary_path(), t=threads, q=query, scale=scale) #if only_cbar: # filename = "{bin}/plot_base_flavor__cmap.pgf".format(bin=build_config.get_binary_path()) print("Generating {}".format(filename)) cmd = "{bin}/print_explore_pipeline_flavors.py --num_threads {t} -q {q} --plot={file} -s {scale}".format( bin=build_config.get_binary_path(), t=threads, q=query, file=filename, scale=scale) print(cmd) p = subprocess.Popen(cmd, shell=True) p.wait()
def main(): for name in [ "run_explore_pipeline_flavor.py", "print_base_flavors.py", "run_perf_baseline.py" ]: cmd = "{path}/{name}".format(path=build_config.get_binary_path(), name=name) print("Run: " + cmd) subprocess.run(cmd, shell=True)
def plot_blend_flavor(query, threads, scale, restrict): filename = "{bin}/plot_blend_flavor__q_{q}__t_{t}__sf_{scale}{postfix}.pgf".format( bin=build_config.get_binary_path(), t=threads, q=query, scale=scale, postfix="_restrict" if restrict else "") #if only_cbar: # filename = "{bin}/plot_base_flavor__cmap.pgf".format(bin=build_config.get_binary_path()) print("Generating {}".format(filename)) cmd = "{bin}/print_explore_blends.py --num_threads {t} -q {q} {args} --plot={file} -s {scale}".format( bin=build_config.get_binary_path(), t=threads, q=query, file=filename, scale=scale, args="--restrict" if restrict else "") print(cmd) p = subprocess.Popen(cmd, shell=True) p.wait()
def __plot_base_flavor(query, threads, only_cbar, scale, typ): filename = "{bin}/plot_base_flavor__q_{q}__t_{t}__sf_{scale}{postfix}.pgf".format( bin=build_config.get_binary_path(), t=threads, q=query, scale=scale, postfix="" if typ == "3d" else "_{}".format(typ)) #if only_cbar: # filename = "{bin}/plot_base_flavor__cmap.pgf".format(bin=build_config.get_binary_path()) print("Generating {}".format(filename)) cmd = "{bin}/print_base_flavors.py --num_threads {t} -q {q} {args} --type={typ} --plot={file} -s {scale}".format( bin=build_config.get_binary_path(), t=threads, q=query, file=filename, scale=scale, args="" if only_cbar else "--no-colorbar", typ=typ) print(cmd) p = subprocess.Popen(cmd, shell=True) p.wait()
def get_filename(): return build_config.get_binary_path() + '/related_work_imv.csv'
def main(): max_num_cores = multiprocessing.cpu_count() scale_factors = [1, 10, 100] threads = [max_num_cores] # threads = list(set(powers2_until(max_num_cores) + [max_num_cores])) queries = ["imv1"] runs = 5 imv = build_config.get_binary_path() + "/../../imv/build/engine" executables = [ build_config.get_binary_path() + "/../../imv/build/run_tpch", imv ] with open(get_filename(), 'w') as f: f.write("#NAME|TIME_MS|CYC_TUP|THREADS|SF|RUNS\n") for scale in scale_factors: for exe_path in executables: tpch_path = build_config.get_binary_path( ) + "/tpch_{scale}".format(scale=scale) for t in threads: cmd = "{exe_path} {runs} {tpch_path} {threads}".format( exe_path=exe_path, runs=runs, tpch_path=tpch_path, threads=t) print(cmd) pipe = subprocess.Popen(cmd, encoding='utf8', shell=True, stdout=subprocess.PIPE) # out, err = pipe.communicate() for line in pipe.stdout: values = list(map(lambda x: x.strip(), line.split(","))) name = values[0] prefixes = [ "q", "compilation", "imv", "rof", "rof-imv" ] match = False for p in prefixes: if name.startswith(p): match = True break if not match: continue if exe_path == imv: name = "imv1 " + name f.write( "{name}|{time}|{cycles}|{threads}|{scale}|{runs}\n" .format(name=name, time=values[1], threads=t, scale=scale, runs=runs, cycles=values[8]))
def get_filename(): return build_config.get_binary_path() + '/baselines.csv'
def main(): max_num_cores = multiprocessing.cpu_count() scale_factors = [100, 10, 1] threads = [max_num_cores, int(max_num_cores / 2), 1] # threads = list(set(powers2_until(max_num_cores) + [max_num_cores])) queries = ["q1", "q3", "q6", "q9", "imv1"] runs = 5 with open(get_filename(), 'w') as f: f.write("#NAME|TIME_MS|CYC_TUP|THREADS|SF|RUNS\n") for scale in scale_factors: tpch_path = build_config.get_binary_path( ) + "/tpch_{scale}".format(scale=scale) exe_path = build_config.get_binary_path( ) + "/../../dbengineparadigms/build/run_tpch" for t in threads: cmd = "{exe_path} {runs} {tpch_path} {threads}".format( exe_path=exe_path, runs=runs, tpch_path=tpch_path, threads=t) print(cmd) pipe = subprocess.Popen(cmd, encoding='utf8', shell=True, stdout=subprocess.PIPE) # out, err = pipe.communicate() for line in pipe.stdout: values = list(map(lambda x: x.strip(), line.split(","))) name = values[0] if not name.startswith("q"): continue f.write( "{name}|{time}|{cycles}|{threads}|{scale}|{runs}\n". format(name=values[0], time=values[1], threads=t, scale=scale, runs=runs, cycles=values[8])) for scale in scale_factors: for t in threads: for q in queries: for flavor in ["hyper", "vector"]: cmd = """{voila} -s {scale} --mode {db} --flavor={flavor} --num_threads {t} -q {q} -r {runs}""".format( voila=build_config.get_main_executable(), db=get_tag(), t=t, q=q, scale=scale, runs=runs, flavor=flavor) print(cmd) subprocess.run(cmd, shell=True) for t in threads: for q in queries: for blend in ["scalar", "vector(1024)"]: cmd = """{voila} -s {scale} --mode {db} --{blend} --num_threads {t} -q {q} -r {runs}""".format( voila=build_config.get_main_executable(), db=get_tag(), t=t, q=q, scale=scale, runs=runs, blend= """default_blend="computation_type={comp},concurrent_fsms=1,prefetch=0" """ .format(comp=blend)) print(cmd) subprocess.run(cmd, shell=True)