Skip to content
Snippets Groups Projects
Commit fe9e73e8 authored by Sami Evangelista's avatar Sami Evangelista
Browse files

d5-comp latex table generation updated

parent ec08e3a6
Branches master
No related tags found
No related merge requests found
......@@ -34,6 +34,12 @@ def algo_name(algo):
"dbfs": "Euro-Par'2018 distributed algorithm",
"dbfs-collapse": "ICECCS'2018 distributed algorithm"
}[algo]
def cite_name(algo):
return {
"mc": "EKP13",
"dbfs": "CEP18",
"dbfs-collapse": "CEP18-2"
}[algo]
def algo_color(algo):
return {
"mc": "blue",
......@@ -167,15 +173,59 @@ for algo in [a for a in algos if a != REF_ALGO]:
) for row in rows]))
fd.write("\n\\\\\\hline\n")
fd.write("\\end{tabular}\n")
with open(f"table-xp-comp-all.tex", "w") as fd:
fd.write(TEX_HEADER)
fd.write("\\begin{table}\n")
fd.write(f"\\centering\\input{{table-xp-comp-{algo}}}\n")
aname = algo_name(algo)
bname = algo_name(REF_ALGO)
fd.write(f"\\caption{{{aname} versus {bname}}}\n")
fd.write("\\end{table}\n")
fd.write(TEX_FOOTER)
with open(f"table-xp-comp.tex", "w") as fd:
rows = list()
fd.write(TEX_HEADER)
for algo in [a for a in algos if a != REF_ALGO]:
fd.write("\\begin{table}\n")
fd.write(f"\\centering\\input{{table-xp-comp-{algo}}}\n")
aname = algo_name(algo)
bname = algo_name(REF_ALGO)
fd.write(f"\\caption{{{aname} versus {bname}}}\n")
fd.write("\\end{table}\n")
pass
rows = list()
ok_procs = set()
for model in [m for m in models if REF_ALGO in data[m]]:
row = [ r"\textsf{" + model.replace("_", "\\_") + "}" ]
for algo in [a for a in algos if a != REF_ALGO]:
row.append("vs \\cite{" + cite_name(algo) + "}")
for proc in procs:
if proc in data[model][REF_ALGO] and proc in data[model][algo]:
ref_time = data[model][REF_ALGO][proc][1]
algo_time = data[model][algo][proc][1]
new = str("{:.2f}".format(ref_time / algo_time))
ok_procs.add(proc)
else:
new = "-"
row.append(new)
rows.append(row)
rows.append(["\\\\"])
row = [ "" ]
rows.append(["\\hline"])
ok_procs = sorted(list(ok_procs))
cols = set([ 0, 1 ] + list(set(procs.index(p) + 2 for p in ok_procs)))
#
fd.write("\\begin{center}\n")
fd.write("\\begin{tabular}{|l|l|" + (len(procs) * "r|") + "}\n")
fd.write("\\hline\n")
fd.write("\\rowcolor{lightgray}")
fd.write("\\multicolumn{1}{|c}{Model} &")
fd.write("\\multicolumn{1}{c|}{} &")
fd.write(
"\\multicolumn{" + str(len(cols) - 2) + "}{c|}{Threads/Processes}\\\\"
)
fd.write("\\rowcolor{lightgray}")
fd.write("\\multicolumn{2}{|c|}{} &")
fd.write("&".join(str(p) for p in ok_procs) + "\\\\\n")
fd.write("\\hline\n")
fd.write("\n".join(["\n& ".join(
val for col, val in enumerate(row) if col in cols
) for row in rows]))
fd.write("\\end{tabular}\n")
fd.write("\\end{center}\n")
fd.write("\\bibliographystyle{plain}")
fd.write("\\bibliography{biblio}")
fd.write(TEX_FOOTER)
exit(0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment