diff --git a/collect_data.sh b/collect_data.sh new file mode 100755 index 0000000..1d18cd6 --- /dev/null +++ b/collect_data.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +if [ -z $1 ] +then + THREADS=4 +else + THREADS=$1 + if [ $1 -le 0 ] + then + echo "thread num must be greater then 0" + exit 1 + fi +fi + +if [ -z $2 ] +then + FILENAME=data.txt +else + FILENAME=$2 +fi + +rm $FILENAME 2> /dev/null + +for i in $(eval echo {1..$THREADS}) +do + ./run -r 100000000 -i 5 -n $i | tee -a $FILENAME +done + + diff --git a/makeplots.py b/makeplots.py new file mode 100755 index 0000000..1537a76 --- /dev/null +++ b/makeplots.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import matplotlib.pylab as plt +import csv + + +x_values = [] +y_values = [] +y_err = [] + +with open('data.txt') as FILE: + data = csv.reader(FILE, delimiter='\t') + for row in data: + x_values.append(float(row[4])) + y_values.append(float(row[0])) + y_err.append(float(row[1])) + print(x_values) + plt.errorbar(x_values,y_values,yerr=y_err) + plt.savefig('plot.png')