experiments #1

Merged
rubydragon merged 39 commits from experiments into main 2024-05-08 12:03:28 +02:00
4 changed files with 90 additions and 9 deletions
Showing only changes of commit 8bbbc72bfc - Show all commits

View File

@ -18,23 +18,32 @@ input_file = ARGS[1]
df = CSV.read(input_file, DataFrame)
# plotting with process size as x axis
THREADS = []
THREADS = [1]
for threads in THREADS
title_string = "n-photon Compton diagram generation, $threads threads"
title_string = "n-photon Compton diagram generation"
df_filt = filter(:cpu_threads => x -> x == threads, df)
df_filt = filter(:process_name => x -> proc_to_n(x) >= 1, df_filt)
# ns -> s
df_filt.graph_gen_mean = @. df_filt.graph_gen_mean / 1e9
df_filt.graph_gen_std = @. df_filt.graph_gen_std / 1e9
df_filt.process_size = @. proc_to_n(df_filt.process_name)
# B -> MB (not MiB since the log scale is base 10)
df_filt.graph_mem = @. df_filt.graph_mem / 1e6
df_filt.graph_mem_reduced = @. df_filt.graph_mem_reduced / 1e6
@df df_filt scatter(
:process_size,
:graph_gen_mean,
yerror = :graph_gen_std,
label = "graph generation time",
df_filt.process_size = @. proc_to_n(df_filt.process_name)
l = length(df_filt.process_size)
@df df_filt scatter(:process_size, :graph_mem, label = "unreduced graph", markersize = 7)
scatter!(
df_filt[!, :process_size][1:(l - 1)],
df_filt[!, :graph_mem_reduced][1:(l - 1)],
label = "reduced graph",
markershape = :square,
markersize = 7,
)
@ -44,7 +53,41 @@ for threads in THREADS
legend = :outerbottom,
minorgrid = true,
xticks = :process_size,
yticks = [1e-3, 1e-2, 1e-1, 1e-0, 1e1],
#yticks = [1e-3, 1e-1, 1e1, 1e3],
xgrid = false,
xminorticks = false,
legendcolumns = 1,
legend_font_pointsize = 10,
size = (800, 600),
ylabel = "memory footprint (MB)",
xlabel = "process size (#)",
)
savefig("gen_memory_$(threads).pdf")
exit(0)
@df df_filt scatter(
:process_size,
:graph_gen_mean,
yerror = :graph_gen_std,
label = "graph generation time",
markersize = 7,
)
scatter!(
df_filt[!, :process_size][1:(l - 1)],
df_filt[!, :graph_elapsed_reduce][1:(l - 1)],
label = "graph reduction time",
markershape = :square,
markersize = 7,
)
plot!(
title = title_string,
yscale = :log10,
legend = :outerbottom,
minorgrid = true,
xticks = :process_size,
yticks = [1e-3, 1e-1, 1e1, 1e3],
xgrid = false,
xminorticks = false,
legendcolumns = 1,

BIN
images/gen_memory.pdf Normal file

Binary file not shown.

View File

@ -95,6 +95,44 @@
"println([num_diagrams(0, n) for n in 2:7])\n",
"println([num_diagrams_small_form(0, n) for n in 2:7])"
]
},
{
"cell_type": "code",
"execution_count": 112,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\\rowcolor[HTML]{9B9B9B}1 && 1 & 0 & 0 & 1 & 1 & 2 & 6 & 24 & 120 \\\\ \\hline\n",
"\\rowcolor[HTML]{C0C0C0}2 && 1 & 1 & 0 & 1 & 4 & 20 & 120 & 840 & 6720 \\\\ \\hline\n",
"\\rowcolor[HTML]{9B9B9B}2 && 2 & 0 & 0 & 2 & 8 & 40 & 240 & 1680 & 13440 \\\\ \\hline\n",
"\\rowcolor[HTML]{C0C0C0}3 && 1 & 1 & 1 & 6 & 42 & 336 & 3024 & 30240 & 332640 \\\\ \\hline\n",
"\\rowcolor[HTML]{9B9B9B}3 && 2 & 1 & 0 & 12 & 84 & 672 & 6048 & 60480 & 665280 \\\\ \\hline\n",
"\\rowcolor[HTML]{C0C0C0}3 && 3 & 0 & 0 & 36 & 252 & 2016 & 18144 & 181440 & 1995840 \\\\ \\hline\n",
"\\rowcolor[HTML]{9B9B9B}4 && 2 & 1 & 1 & 144 & 1440 & 15840 & 190080 & 2471040 & 34594560 \\\\ \\hline\n",
"\\rowcolor[HTML]{C0C0C0}4 && 2 & 2 & 0 & 288 & 2880 & 31680 & 380160 & 4942080 & 69189120 \\\\ \\hline\n",
"\\rowcolor[HTML]{9B9B9B}4 && 3 & 1 & 0 & 432 & 4320 & 47520 & 570240 & 7413120 & 103783680 \\\\ \\hline\n",
"\\rowcolor[HTML]{C0C0C0}4 && 4 & 0 & 0 & 1728 & 17280 & 190080 & 2280960 & 29652480 & 415134720 \\\\ \\hline\n"
]
}
],
"source": [
"# tables\n",
"i = 0\n",
"nums = [[1, 0, 0], [1, 1, 0], [2, 0, 0], [1, 1, 1], [2, 1, 0], [3, 0, 0], [2, 1, 1], [2, 2, 0], [3, 1, 0], [4, 0, 0]]\n",
"for (e, u, t) in nums\n",
" i += 1\n",
" if (u + t + e == 0) continue end\n",
" if (i % 2 == 0) \n",
" print(\"\\\\rowcolor[HTML]{C0C0C0}\")\n",
" else\n",
" print(\"\\\\rowcolor[HTML]{9B9B9B}\")\n",
" end\n",
" println(\"$(e + u + t) && $e & $u & $t & $(num_diagrams(0, e, u, t)) & $(num_diagrams(1, e, u, t)) & $(num_diagrams(2, e, u, t)) & $(num_diagrams(3, e, u, t)) & $(num_diagrams(4, e, u, t)) & $(num_diagrams(5, e, u, t)) \\\\\\\\ \\\\hline\")\n",
"end"
]
}
],
"metadata": {