Commit 0558a9ac authored by Taddeüs Kroes's avatar Taddeüs Kroes

ModSim ass4 taddeus: Added benchmark plot.

parent 5f73cde5
......@@ -10,7 +10,10 @@ dx=`echo "1/$1" | bc -l`
args="sinus 10000 1 $dx 1 2"
# Execute sequential program
/usr/bin/time -f "%e" -o $FILE ./seq $args
/usr/bin/time -f "1 %e" -o $FILE ./seq $args
for i in `seq 2 $REPEAT`; do
/usr/bin/time -f "1 %e" -ao $FILE ./seq $args
done
# Execute parallel program for different numbers of nodes
for i in `seq 2 13`; do
......
......@@ -13,5 +13,5 @@ for i in `seq 3 $1`; do
hosts="$hosts,edu0$cur"
done
mpirun -mca plm_rsh_agent /usr/bin/rsh -n $1 -host $hosts ./par ${@:2:$#}
mpirun -mca plm_rsh_agent /usr/bin/rsh -n $1 -host $hosts ./par ${@:2:$#}
#mpirun -np ${1-4} ./par ${@:2:$#}
#!/usr/bin/env python
from sys import argv
from pylab import plot, xlabel, ylabel, show, savefig
from scipy import polyfit, polyval
# Collect data
x = []
y = []
results = open('bench.txt')
for line in results.readlines()[1:]:
for line in results.readlines():
n, t = line[:-1].split(' ')
# Use the minimum of all measurements
......@@ -19,8 +19,18 @@ for line in results.readlines()[1:]:
x.append(int(n))
y.append(float(t))
# Plot data
plot(x, y, 'o-')
seq = [x[0], y[0]]
x = x[1:]
y = y[1:]
# Least squares data fit
c = tuple(polyfit(, y, 2).tolist())
fit = polyval(c, x)
# Plot and optionally save data
plot(x, y, 'x')
plot(seq[0], seq[1], 'x')
plot(x, fit, '-')
xlabel('Aantal processen')
ylabel('Tijd (s)')
if len(argv) > 1:
......
......@@ -366,10 +366,15 @@ geconcludeerd dat ook het parallelle programma correct is geïmplementeerd..
\begin{figure}[H]
\includegraphics[width=10cm]{benchmark.pdf}
\caption{Runtime met parameters \texttt{sinus 10000 1 .00002 1 2}.}
\end{figure}
\pagebreak
\appendix
\section{Uitvoer testts}
\section{Uitvoer tests}
\subsection{Test 1}
\label{app:test-1}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment