Commit 7e10f43e authored by Taddeüs Kroes's avatar Taddeüs Kroes

ModSim ass4 taddeus: Finished benchmark script.

parent 3f2e25b4
#!/bin/bash #!/bin/bash
if [ $# -lt 3 ]; then if [ $# -lt 3 ]; then
echo "Usage: bash $0 MAX STEP STRING_STEPS" echo "Usage: bash $0 RESULTS_FILE MAX STEP STRING_STEPS"
exit 1 exit 1
fi fi
dx=`echo "1/$3" | bc -l` REPEAT=3
dx=`echo "1/$4" | bc -l`
args="sinus 1000 1 $dx 1 2" args="sinus 1000 1 $dx 1 2"
# Execute sequential program # Execute sequential program
#/usr/bin/time -f "%e" --quiet ./seq $args #/usr/bin/time -f "%e" --quiet ./seq $args
# Clear results file
echo "" > $1
# Execute parallel program for different numbers of nodes # Execute parallel program for different numbers of nodes
for (( i=2; i <= $1; i += $2 )); do for (( i=2; i <= $2; i += $3 )); do
echo `/usr/bin/time -f "$i %e" --quiet ./par.sh $i $args` for j in seq $REPEAT; do
/usr/bin/time -f "$i %e" --quiet -ao $1 ./par.sh $i $args
done
done done
#!/usr/bin/env python #!/usr/bin/env python
from sys import stdin, argv from sys import stdin, argv, exit
from pylab import plot, show, savefig from pylab import plot, show, savefig
if len(argv) < 2:
print 'Usage: python %s BENCHMARK_FILE' % argv[0]
exit(1)
# Collect data # Collect data
x = [] x = []
y = [] y = []
print stdin.readlines() results = open(argv[1])
for line in stdin.readlines():
n, t = line.split(' ') for line in results.readlines()[1:]:
n, t = line[:-1].split(' ')
# Use the minimum of all measurements
if len(x) and x[-1] is int(n) and y[-1] > float(t):
y[-1] = float(t)
continue
x.append(int(n)) x.append(int(n))
y.append(float(t)) y.append(float(t))
# Plot data # Plot data
print x, y
plot(x, y, 'o-') plot(x, y, 'o-')
if len(argv) == 2: if len(argv) == 3:
savefig(argv[1]) savefig(argv[2])
show() show()
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