Changeset 625f3e2 for doc/theses/colby_parsons_MMAth/benchmarks/actors
- Timestamp:
- Mar 7, 2023, 4:50:09 PM (22 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- dd16dd5
- Parents:
- 50d2513
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/plotData.py
r50d2513 r625f3e2 10 10 from statistics import median 11 11 12 import matplotlib 13 matplotlib.use("pgf") 14 matplotlib.rcParams.update({ 15 "pgf.texsystem": "pdflatex", 16 'font.family': 'serif', 17 'text.usetex': True, 18 'pgf.rcfonts': False, 19 }) 20 12 21 readfile = open(sys.argv[1], "r") 22 23 machineName = "" 24 25 if len(sys.argv) > 2: 26 machineName = sys.argv[2] 13 27 14 28 # first line has num times per experiment … … 47 61 name = "" 48 62 var_name = "" 63 sendData = [0.0 for j in range(numVariants)] 49 64 data = [[0.0 for i in range(len(procs))] for j in range(numVariants)] 50 65 bars = [[[0.0 for i in range(len(procs))],[0.0 for k in range(len(procs))]] for j in range(numVariants)] … … 64 79 currBench = Bench.Repeat 65 80 elif line == "balance_one": 66 name = "Balance _One"81 name = "Balance-One" 67 82 currBench = Bench.Balance_One 68 83 elif line == "balance_multi": 69 name = "Balance _Multi"84 name = "Balance-Multi" 70 85 currBench = Bench.Balance_Multi 71 86 elif line == "static": … … 84 99 85 100 if currBench == Bench.Static or currBench == Bench.Dynamic: 86 print("NOT YET IMPLEMENTED") 87 sys.exit() 101 if not nameSet: 102 nameSet = True 103 continue 104 lineArr = line.split() 105 tempData[count] = float(lineArr[-1]) 106 count += 1 107 if count == numTimes: 108 currMedian = median( tempData ) 109 sendData[currVariant] = currMedian 110 count = 0 111 nameSet = False 112 currVariant += 1 113 114 if currVariant == numVariants: 115 fileName = "data/" + machineName 116 if currBench == Bench.Static: 117 fileName += "SendStatic" 118 else: 119 fileName += "SendDynamic" 120 f = open(fileName, 'w') 121 f.write(" & ".join(map(lambda a: str(int(a)) + 'ns', sendData))) 122 123 # reset 124 currBench = Bench.Unset 125 currVariant = 0 126 88 127 else: 89 128 if not nameSet: … … 122 161 plt.ylim(0, None) 123 162 ax.legend(names) 124 fig.savefig("plots/" + name + ".png") 163 # fig.savefig("plots/" + name + ".png") 164 plt.savefig("plots/" + machineName + name + ".pgf") 125 165 fig.clf() 126 166
Note: See TracChangeset
for help on using the changeset viewer.