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

ModSim ass4 taddeus: Finished benchmark script.

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