Commit 5c46796a authored by Taddeüs Kroes's avatar Taddeüs Kroes

MosSim ass4 taddeus: Removed useless parameter.

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