iccsa-21-guile

git clone https://git.igankevich.com/iccsa-21-guile.git
Log | Files | Refs

commit e63b58b7c43577db938051f053f45d8e507088cb
parent 24346767ceedcf9e26c3aadfd80d7ed4224064f8
Author: Ivan Gankevich <i.gankevich@spbu.ru>
Date:   Mon, 10 May 2021 17:25:25 +0300

Benchmark data.

Diffstat:
.gitignore | 1-
Makefile | 4++--
data/guile/fold-pairwise.log | 12++++++++++++
data/guile/fold-right.log | 12++++++++++++
data/guile/map.log | 12++++++++++++
data/sbn-guile/fold-pairwise.log | 12++++++++++++
data/sbn-guile/fold-right.log | 12++++++++++++
data/sbn-guile/map.log | 12++++++++++++
gnuplot/paired.pal | 28++++++++++++++++++++++++++++
gnuplot/results.gnuplot | 17+++++++++++++++++
main.tex | 42+++++++++++++++++++++++++++++++-----------
11 files changed, 150 insertions(+), 14 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -8,7 +8,6 @@ CoA_Medium.eps ## Core latex/pdflatex auxiliary files: *.aux *.lof -*.log *.lot *.fls *.out diff --git a/Makefile b/Makefile @@ -15,6 +15,7 @@ all: build/iccsa-21-guile-slides.pdf build/main.pdf: main.tex build/main.pdf: main.bib +build/main.pdf: build/gnuplot/results.eps build/main.pdf: @echo " LATEX $<" @-$(LATEXMK) $(FLAGS) -f main.tex @@ -36,8 +37,7 @@ build/gnuplot/%.svg: gnuplot/%.gnuplot @mkdir -p build/gnuplot gnuplot -d $< -build/inkscape/%.eps: inkscape/%.svg - @mkdir -p build/inkscape +build/%.eps: build/%.svg inkscape -z --export-eps=$@ $< #build/main.zip: build/gnuplot/*.eps main.tex diff --git a/data/guile/fold-pairwise.log b/data/guile/fold-pairwise.log @@ -0,0 +1,12 @@ +1 19.139818972 +2 19.057740919 +3 19.049894232 +4 19.052040758 +5 19.053126634 +6 19.046809626 +7 19.057907972 +8 19.049239834 +9 19.051101706 +10 19.050114555 +11 19.043003567 +12 19.040350732 diff --git a/data/guile/fold-right.log b/data/guile/fold-right.log @@ -0,0 +1,12 @@ +1 19.352625686 +2 19.253280708 +3 19.248060727 +4 19.262536648 +5 19.249318876 +6 19.258713868 +7 19.253488367 +8 19.253550273 +9 19.251734918 +10 19.253784533 +11 19.247546492 +12 19.249037369 diff --git a/data/guile/map.log b/data/guile/map.log @@ -0,0 +1,12 @@ +1 19.310659816 +2 19.241766432 +3 19.239596232 +4 19.257602393 +5 19.265467084 +6 19.265980918 +7 19.264845598 +8 19.257695208 +9 19.257409982 +10 19.262084710 +11 19.262655911 +12 19.262249028 diff --git a/data/sbn-guile/fold-pairwise.log b/data/sbn-guile/fold-pairwise.log @@ -0,0 +1,12 @@ +1 19.178290037 +2 16.585960297 +3 14.376431999 +4 12.808849845 +5 11.991265368 +6 11.600912402 +7 11.439204277 +8 11.659686277 +9 11.624058564 +10 11.239188283 +11 11.070927368 +12 10.860139921 diff --git a/data/sbn-guile/fold-right.log b/data/sbn-guile/fold-right.log @@ -0,0 +1,12 @@ +1 19.324072923 +2 19.327650243 +3 19.336362814 +4 19.321945213 +5 19.321792085 +6 19.347215289 +7 19.332377469 +8 19.336669790 +9 19.356140338 +10 19.350758614 +11 19.352811014 +12 19.374025724 diff --git a/data/sbn-guile/map.log b/data/sbn-guile/map.log @@ -0,0 +1,12 @@ +1 19.323594606 +2 10.497877181 +3 8.691836072 +4 7.698167625 +5 5.091096025 +6 4.898821311 +7 3.507408046 +8 3.103834534 +9 3.314438457 +10 3.506654131 +11 2.322718144 +12 2.318098650 diff --git a/gnuplot/paired.pal b/gnuplot/paired.pal @@ -0,0 +1,28 @@ +# vim:filetype=gnuplot +# line styles for ColorBrewer Paired +# for use with qualitative/categorical data +# provides 8 colors in 4 pairs +# compatible with gnuplot >=4.2 +# author: Anna Schneider + +# line styles +set style line 1 lt 1 lc rgb '#A6CEE3' # light blue +set style line 2 lt 1 lc rgb '#1F78B4' # dark blue +set style line 3 lt 1 lc rgb '#B2DF8A' # light green +set style line 4 lt 1 lc rgb '#33A02C' # dark green +set style line 5 lt 1 lc rgb '#FB9A99' # light red +set style line 6 lt 1 lc rgb '#E31A1C' # dark red +set style line 7 lt 1 lc rgb '#FDBF6F' # light orange +set style line 8 lt 1 lc rgb '#FF7F00' # dark orange + +# palette +set palette maxcolors 8 +set palette defined ( \ + 0 '#A6CEE3',\ + 1 '#1F78B4',\ + 2 '#B2DF8A',\ + 3 '#33A02C',\ + 4 '#FB9A99',\ + 5 '#E31A1C',\ + 6 '#FDBF6F',\ + 7 '#FF7F00' ) diff --git a/gnuplot/results.gnuplot b/gnuplot/results.gnuplot @@ -0,0 +1,17 @@ +set terminal svg size 500,200 dynamic enhanced round font 'Times, 12' +set xtics nomirror out offset 0,0.5 +set ytics nomirror out offset 0.5,0 +set border 1+2 back +set key outside top right Left reverse width -10 +set grid +set xlabel 'No. of threads' offset 0,1.0 +set ylabel 'Time, s' offset 1.5,0 +set output 'build/gnuplot/results.svg' +load 'gnuplot/paired.pal' +plot \ +'data/guile/map.log' with linespoints ls 1 pt 12 ps 1.5 title 'map (Guile)', \ +'data/sbn-guile/map.log' with linespoints ls 2 pt 1 title 'map (Guile + kernels)', \ +'data/guile/fold-right.log' with linespoints ls 3 pt 3 title 'fold (Guile)', \ +'data/sbn-guile/fold-right.log' with linespoints ls 4 pt 4 title 'fold (Guile + kernels)', \ +'data/guile/fold-pairwise.log' with linespoints ls 5 pt 8 title 'fold-pairwise (Guile)', \ +'data/sbn-guile/fold-pairwise.log' with linespoints ls 6 pt 6 title 'fold-pairwise (Guile + kernels)' diff --git a/main.tex b/main.tex @@ -625,23 +625,43 @@ label={lst-parallel-forms}] \section{Results} -In order to test performance of our interpreter we used a programme that -processes frequency-directional spectra of ocean waves from NDBC -dataset~\cite{ndbc-web-data-guide,ndbc-techreport}. Each spectrum consists of -five variables, each of which is stored in a separate file in a form of time -series. First, we find five files that correspond to the same station where -the data was collected and the same year. Then we merge the corresponding -records from these files into single vector-valued time series. Incomplete -groups of files and incomplete records are removed. After that we write the -resulting groups to disk. We wrote this programme in C++ with kernels, -in Guile with kernels and in Guile without kernels. +We tested performance of our interpreter using the forms in +listing~\ref{lst-parallel-forms}. For each form we applied synthetic procedure +that sleeps 200 milliseconds to the list with 96 elements. Then we ran the +resulting script using native Guile interpreter and our interpreter and +measured total running time for different number of threads. For native Guile +interpreter the running time of all forms is the same for any number of +threads. For our interpreter \texttt{map} and \texttt{fold-pairwise} forms run +time decreases with the number of threads and for \texttt{fold} form run time +stays the same (figure~\ref{fig-results}). + +\begin{figure} + \centering + \includegraphics{build/gnuplot/results.eps} + \caption{The run time of the forms from listing~\ref{lst-parallel-forms} + for different number of parallel threads and different interpreters.\label{fig-results}} +\end{figure} + + + + +%In order to test performance of our interpreter we used a programme that +%processes frequency-directional spectra of ocean waves from NDBC +%dataset~\cite{ndbc-web-data-guide,ndbc-techreport}. Each spectrum consists of +%five variables, each of which is stored in a separate file in a form of time +%series. First, we find five files that correspond to the same station where +%the data was collected and the same year. Then we merge the corresponding +%records from these files into single vector-valued time series. Incomplete +%groups of files and incomplete records are removed. After that we write the +%resulting groups to disk. We wrote this programme in C++ with kernels, +%in Guile with kernels and in Guile without kernels. \section{Discussion} Computing procedure arguments in parallel is a natural way of expressing parallelism in functional language, and in our tests the performance of the programme is close to the one with manual parallelism. Lower performance is -explained by the fact that we introduce more overhead by using asyncrhonous +explained by the fact that we introduce more overhead by using asynchronous kernels to compute procedure arguments where this does not give large performance gains (even with ideal parallelism with no overhead). If we remove these overheads we will get the same time as the original programme with manual