Changeset d24b1985 for doc/theses/colby_parsons_MMAth/benchmarks/channels
- Timestamp:
- Mar 30, 2023, 4:05:14 PM (17 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 9082d7e8
- Parents:
- e2f827f
- Location:
- doc/theses/colby_parsons_MMAth/benchmarks/channels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/benchmarks/channels/plotData.py
re2f827f rd24b1985 36 36 procs.append(int(val)) 37 37 38 # 3rd line has num locks args 39 line = readfile.readline() 40 locks = [] 41 for val in line.split(): 42 locks.append(int(val)) 43 44 # 4th line has number of variants 38 # 3rd line has number of variants 45 39 line = readfile.readline() 46 40 names = line.split() … … 50 44 lines = (line for line in lines if line) # Non-blank lines 51 45 46 class Bench(Enum): 47 Unset = 0 48 Contend = 1 49 Zero = 2 50 Barrier = 3 51 Churn = 4 52 Daisy_Chain = 5 53 Hot_Potato = 6 54 Pub_Sub = 7 55 52 56 nameSet = False 53 curr Locks = -1# default val57 currBench = Bench.Unset # default val 54 58 count = 0 55 59 procCount = 0 56 60 currVariant = 0 57 name = " Aggregate Lock"61 name = "" 58 62 var_name = "" 59 63 sendData = [0.0 for j in range(numVariants)] … … 64 68 # print(line) 65 69 66 if currLocks == -1: 67 lineArr = line.split() 68 currLocks = lineArr[-1] 70 if currBench == Bench.Unset: 71 if line == "contend:": 72 name = "Contend" 73 currBench = Bench.Contend 74 elif line == "zero:": 75 name = "Zero" 76 currBench = Bench.Zero 77 elif line == "barrier:": 78 name = "Barrier" 79 currBench = Bench.Barrier 80 elif line == "churn:": 81 name = "Churn" 82 currBench = Bench.Churn 83 elif line == "daisy_chain:": 84 name = "Daisy_Chain" 85 currBench = Bench.Daisy_Chain 86 elif line == "hot_potato:": 87 name = "Hot_Potato" 88 currBench = Bench.Hot_Potato 89 elif line == "pub_sub:": 90 name = "Pub_Sub" 91 currBench = Bench.Pub_Sub 92 else: 93 print("Expected benchmark name") 94 print("Line: " + line) 95 sys.exit() 69 96 continue 70 97 … … 95 122 if currVariant == numVariants: 96 123 fig, ax = plt.subplots() 97 plt.title(name + " Benchmark : " + str(currLocks) + " Locks")98 plt.ylabel("Throughput ( entries)")124 plt.title(name + " Benchmark") 125 plt.ylabel("Throughput (channel operations)") 99 126 plt.xlabel("Cores") 100 127 for idx, arr in enumerate(data): 101 128 plt.errorbar( procs, arr, [bars[idx][0], bars[idx][1]], capsize=2, marker='o' ) 129 102 130 plt.yscale("log") 131 # plt.ylim(1, None) 132 # ax.get_yaxis().set_major_formatter(ticks.ScalarFormatter()) 133 # else: 134 # plt.ylim(0, None) 103 135 plt.xticks(procs) 104 136 ax.legend(names) 105 # fig.savefig("plots/" + machineName + "Aggregate_Lock_" + str(currLocks)+ ".png")106 plt.savefig("plots/" + machineName + "Aggregate_Lock_" + str(currLocks)+ ".pgf")137 # fig.savefig("plots/" + machineName + name + ".png") 138 plt.savefig("plots/" + machineName + name + ".pgf") 107 139 fig.clf() 108 140 109 141 # reset 110 curr Locks = -1142 currBench = Bench.Unset 111 143 currVariant = 0 -
doc/theses/colby_parsons_MMAth/benchmarks/channels/run
re2f827f rd24b1985 85 85 } 86 86 87 numtimes=11 88 89 # locks=('-DLOCKS=L1' '-DLOCKS=L2' '-DLOCKS=L3' '-DLOCKS=L4' '-DLOCKS=L5' '-DLOCKS=L6' '-DLOCKS=L7' '-DLOCKS=L8') 90 # locks='1 2 3 4 5 6 7 8' 91 lock_flags=('-DLOCKS=L2' '-DLOCKS=L4' '-DLOCKS=L8') 92 locks=('2' '4' '8') 87 numtimes=5 93 88 94 89 num_threads='2 4 8 16 24 32' 95 # num_threads='2 4 8'90 # num_threads='2' 96 91 97 92 # toggle benchmarks 98 order=${true} 99 rand=${true} 100 baseline=${true} 93 zero=${false} 94 contend=${true} 95 barrier=${false} 96 churn=${false} 97 daisy_chain=${false} 98 hot_potato=${false} 99 pub_sub=${false} 101 100 102 101 runCFA=${true} 103 run CPP=${true}102 runGO=${true} 104 103 # runCFA=${false} 105 # run CPP=${false}104 # runGO=${false} 106 105 107 106 cfa=~/cfa-cc/driver/cfa 108 cpp=g++109 107 110 108 # Helpers to minimize code duplication … … 152 150 echo $num_threads 153 151 154 for i in ${!locks[@]}; do 155 echo -n ${locks[$i]}' ' 156 done 157 echo "" 158 159 if [ ${runCFA} -eq ${true} ] && [ ${order} -eq ${true} ]; then 160 echo -n 'CFA-order ' 161 fi 162 if [ ${runCPP} -eq ${true} ] && [ ${order} -eq ${true} ]; then 163 echo -n 'CPP-order ' 164 fi 165 if [ ${runCFA} -eq ${true} ] && [ ${baseline} -eq ${true} ]; then 166 echo -n 'CFA-baseline ' 167 fi 168 if [ ${runCPP} -eq ${true} ] && [ ${baseline} -eq ${true} ]; then 169 echo -n 'CPP-baseline ' 170 fi 171 if [ ${runCFA} -eq ${true} ] && [ ${rand} -eq ${true} ]; then 172 echo -n 'CFA-rand ' 173 fi 174 if [ ${runCPP} -eq ${true} ] && [ ${rand} -eq ${true} ]; then 175 echo -n 'CPP-rand ' 152 if [ ${runCFA} -eq ${true} ]; then 153 echo -n 'CFA ' 154 fi 155 if [ ${runGO} -eq ${true} ]; then 156 echo -n 'Go ' 176 157 fi 177 158 echo "" … … 182 163 cfa_flags='-quiet -O3 -nodebug -DNDEBUG' 183 164 184 # cpp flagse185 cpp_flags='-O3 -std=c++17 -lpthread -pthread -DNDEBUG'186 187 165 # run the benchmarks 188 166 189 run_ order() {167 run_contend() { 190 168 post_args=${1} 191 169 192 170 if [ ${runCFA} -eq ${true} ] ; then 193 171 cd cfa # CFA RUN 194 print_header 'CFA -'${3}195 ${cfa} ${cfa_flags} ${2} ${3}.cfa -o a.${hostname} > /dev/null 2>&1172 print_header 'CFA' 173 ${cfa} ${cfa_flags} ${2}.cfa -o a.${hostname} > /dev/null 2>&1 196 174 run_bench 197 175 rm a.${hostname} … … 199 177 fi # done CFA 200 178 201 if [ ${run CPP} -eq ${true} ] ; then202 cd cpp # CPPRUN203 print_header ' CPP-'${3}204 ${cpp} ${cpp_flags} ${2} ${3}.cc-o a.${hostname} > /dev/null 2>&1179 if [ ${runGO} -eq ${true} ] ; then 180 cd go/${2} # Go RUN 181 print_header 'Go' 182 go build -o a.${hostname} > /dev/null 2>&1 205 183 run_bench 206 184 rm a.${hostname} 207 185 cd - > /dev/null 208 fi # done CPP186 fi # done Go 209 187 } 210 188 211 189 # /usr/bin/time -f "%Uu %Ss %Er %Mkb" 212 213 for i in ${!locks[@]}; do 214 echo "locks: "${locks[$i]} 215 if [ ${order} -eq ${true} ] ; then 216 run_order ${locks[$i]} ${lock_flags[$i]} 'order' 217 fi 218 if [ ${baseline} -eq ${true} ] ; then 219 run_order ${locks[$i]} ${lock_flags[$i]} 'baseline' 220 fi 221 if [ ${rand} -eq ${true} ] ; then 222 run_order ${locks[$i]} '-DLOCKS=L8' 'rand' 223 fi 224 done 225 226 190 if [ ${contend} -eq ${true} ] ; then 191 echo "contend: " 192 run_contend '128' 'contend' 193 fi 194 195 if [ ${zero} -eq ${true} ] ; then 196 echo "zero: " 197 run_contend '0' 'contend' 198 fi 199 200 if [ ${barrier} -eq ${true} ] ; then 201 echo "barrier: " 202 run_contend '' 'barrier' 203 fi 204 205 if [ ${churn} -eq ${true} ] ; then 206 echo "churn: " 207 run_contend '' 'churn' 208 fi 209 210 if [ ${daisy_chain} -eq ${true} ] ; then 211 echo "daisy_chain: " 212 run_contend '' 'daisy_chain' 213 fi 214 215 if [ ${hot_potato} -eq ${true} ] ; then 216 echo "hot_potato: " 217 run_contend '' 'hot_potato' 218 fi 219 220 if [ ${pub_sub} -eq ${true} ] ; then 221 echo "pub_sub: " 222 run_contend '' 'pub_sub' 223 fi
Note: See TracChangeset
for help on using the changeset viewer.