diff --git a/README.md b/README.md index 6e54070..6dc1733 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ # benchmark-openMP some benchamarks with openMP in C + +## compile +make to compile + +##usage +then +```bash +./collect_data.sh +``` +to run program with 1 to num threads +you can specify reps per iteration and iterations in collect\_data.sh + +run +```bash +./make_plots.py +``` +to make plot diff --git a/makeplots.py b/makeplots.py index 40bb517..3935b40 100755 --- a/makeplots.py +++ b/makeplots.py @@ -2,13 +2,22 @@ import matplotlib.pylab as plt import csv +import sys +if len(sys.argv) == 2: + infile = sys.argv[1] +else: + infile = 'data.txt' +if len(sys.argv) == 3: + outfile = sys.argv[2] +else: + outfile = 'plot.png' x_values = [] y_values = [] y_err = [] -with open('data.txt') as FILE: +with open(infile) as FILE: data = csv.reader(FILE, delimiter='\t') for row in data: x_values.append(float(row[4])) @@ -16,4 +25,4 @@ with open('data.txt') as FILE: y_err.append(float(row[1])) print(x_values) plt.errorbar(x_values,y_values,yerr=y_err, fmt='.') - plt.savefig('plot.png') + plt.savefig(outfile)