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` ...@@ -10,7 +10,10 @@ dx=`echo "1/$1" | bc -l`
args="sinus 10000 1 $dx 1 2" args="sinus 10000 1 $dx 1 2"
# Execute sequential program # 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 # Execute parallel program for different numbers of nodes
for i in `seq 2 13`; do for i in `seq 2 13`; do
......
#!/usr/bin/env python #!/usr/bin/env python
from sys import argv from sys import argv
from pylab import plot, xlabel, ylabel, show, savefig from pylab import plot, xlabel, ylabel, show, savefig
from scipy import polyfit, polyval
# Collect data # Collect data
x = [] x = []
y = [] y = []
results = open('bench.txt') results = open('bench.txt')
for line in results.readlines():
for line in results.readlines()[1:]:
n, t = line[:-1].split(' ') n, t = line[:-1].split(' ')
# Use the minimum of all measurements # Use the minimum of all measurements
...@@ -19,8 +19,18 @@ for line in results.readlines()[1:]: ...@@ -19,8 +19,18 @@ for line in results.readlines()[1:]:
x.append(int(n)) x.append(int(n))
y.append(float(t)) y.append(float(t))
# Plot data seq = [x[0], y[0]]
plot(x, y, 'o-') 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') xlabel('Aantal processen')
ylabel('Tijd (s)') ylabel('Tijd (s)')
if len(argv) > 1: if len(argv) > 1:
......
...@@ -366,10 +366,15 @@ geconcludeerd dat ook het parallelle programma correct is geïmplementeerd.. ...@@ -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 \pagebreak
\appendix \appendix
\section{Uitvoer testts} \section{Uitvoer tests}
\subsection{Test 1} \subsection{Test 1}
\label{app: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