Updates to README, addition of plotting script and sample data

This commit is contained in:
Wes Bethel 2022-10-18 07:10:47 -07:00
parent 5d358e01dd
commit 9185be7074
3 changed files with 75 additions and 0 deletions

View File

@ -89,4 +89,9 @@ or
When you run each code, it will iterate through the set of problem sizes predefined inside benchmark.cpp When you run each code, it will iterate through the set of problem sizes predefined inside benchmark.cpp
# Building and running the codes on Cori@NERSC
Please refer to lecture slides for additional information about accessing Cori, building your code there, and running your code there.
# EOF # EOF

62
plot_3vars.py Normal file
View File

@ -0,0 +1,62 @@
"""
E. Wes Bethel, Copyright (C) 2022
October 2022
Description: This code loads a .csv file and creates a 3-variable plot
Inputs: the named file "sample_data_3vars.csv"
Outputs: displays a chart with matplotlib
Dependencies: matplotlib, pandas modules
Assumptions: developed and tested using Python version 3.8.8 on macOS 11.6
"""
import pandas as pd
import matplotlib.pyplot as plt
fname = "sample_data_3vars.csv"
df = pd.read_csv(fname, comment="#")
print(df)
var_names = list(df.columns)
print("var names =", var_names)
# split the df into individual vars
# assumption: column order - 0=problem size, 1=blas time, 2=basic time
problem_sizes = df[var_names[0]].values.tolist()
code1_time = df[var_names[1]].values.tolist()
code2_time = df[var_names[2]].values.tolist()
code3_time = df[var_names[3]].values.tolist()
plt.title("Comparison of 3 Codes")
xlocs = [i for i in range(len(problem_sizes))]
plt.xticks(xlocs, problem_sizes)
plt.plot(code1_time, "r-o")
plt.plot(code2_time, "b-x")
plt.plot(code3_time, "g-^")
#plt.xscale("log")
#plt.yscale("log")
plt.xlabel("Problem Sizes")
plt.ylabel("runtime")
varNames = [var_names[1], var_names[2], var_names[3]]
plt.legend(varNames, loc="best")
plt.grid(axis='both')
plt.show()
# EOF

8
sample_data_3vars.csv Normal file
View File

@ -0,0 +1,8 @@
# author: E. Wes Bethel, Oct 2022
# sample data for use with the plot_3vars.py file
Problem Size,code 1,code 2,code 3
64,0.00044,0.00128,0.00759
128,0.00061,0.00949,0.05974
256,0.00236,0.0875,0.20877
512,0.01201,0.1418,0.89089
1024,0.07743,0.81365,3.04055
1 # author: E. Wes Bethel, Oct 2022
2 # sample data for use with the plot_3vars.py file
3 Problem Size,code 1,code 2,code 3
4 64,0.00044,0.00128,0.00759
5 128,0.00061,0.00949,0.05974
6 256,0.00236,0.0875,0.20877
7 512,0.01201,0.1418,0.89089
8 1024,0.07743,0.81365,3.04055