Skip to content

Commit ef20391

Browse files
authored
Merge pull request #30 from intellistream/sbug
Sbug
2 parents e4c5a30 + f9abc51 commit ef20391

32 files changed

Lines changed: 626 additions & 624 deletions

‎benchmark/scripts/scanAColCPP/drawTogether.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec
123123
def main():
124124
exeSpace = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/"
125125
commonBase = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/results/" + scanTag + "/"
126-
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag+"CPP"
126+
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag + "CPP"
127127
methodTags = ["FD-AMM", "Co-AMM", "BCo-AMM", "Couter-sketch", "MM"]
128128
resultPaths = ["fd", "co", "co", "cs", "mm"]
129129
csvTemplates = ["config_FDAMM.csv", "config_CoAMM.csv", "config_BCoAMM.csv", "config_CounterSketch.csv",
@@ -139,11 +139,11 @@ def main():
139139
os.system("sudo rm -rf " + commonBase)
140140
os.system("sudo mkdir " + commonBase)
141141
reRun = 1
142-
142+
143143
# sampling
144144
resultPaths = ["crs-cpp", "mm-cpp"]
145145
csvTemplates = ["config_CPPCRS.csv", "config_CPPMM.csv"]
146-
methodTags = ["crs-cpp","mm-cpp"]
146+
methodTags = ["crs-cpp", "mm-cpp"]
147147
elapsedTimeAll, cacheMissAll, periodAll = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
148148
reRun)
149149
groupLine.DrawFigure(periodAll, elapsedTimeAll,

‎benchmark/scripts/scanARowCPP/drawTogether.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec
123123
def main():
124124
exeSpace = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/"
125125
commonBase = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/results/" + scanTag + "/"
126-
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag+"CPP"
126+
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag + "CPP"
127127
methodTags = ["FD-AMM", "Co-AMM", "BCo-AMM", "Couter-sketch", "MM"]
128128
resultPaths = ["fd", "co", "co", "cs", "mm"]
129129
csvTemplates = ["config_FDAMM.csv", "config_CoAMM.csv", "config_BCoAMM.csv", "config_CounterSketch.csv",
130130
"config_RAWMM.csv"]
131-
valueVec = [100,200,500,1000,5000, 10000, 20000, 50000,100000]
131+
valueVec = [100, 200, 500, 1000, 5000, 10000, 20000, 50000, 100000]
132132
valueVecDisp = np.array(valueVec)
133133
# run
134134
reRun = 0
@@ -142,12 +142,12 @@ def main():
142142
# skech
143143

144144
# sampling
145-
#resultPaths = ["crs", "bcrs", "ews", "mm","mm-cpp","crs-cpp"]
146-
resultPaths = ["mm-cpp","crs-cpp"]
147-
csvTemplates = ["config_CPPMM.csv","config_CPPCRS.csv"]
148-
methodTags = ["MM_CPP","CRS_CPP"]
149-
#csvTemplates = ["config_CRS.csv", "config_BerCRS.csv", "config_EWS.csv", "config_RAWMM.csv","config_CPPMM.csv","config_CPPCRS.csv"]
150-
#methodTags = ["CRS", "Ber-CRS", "EWS", "MM","MM_CPP","CRS_CPP"]
145+
# resultPaths = ["crs", "bcrs", "ews", "mm","mm-cpp","crs-cpp"]
146+
resultPaths = ["mm-cpp", "crs-cpp"]
147+
csvTemplates = ["config_CPPMM.csv", "config_CPPCRS.csv"]
148+
methodTags = ["MM_CPP", "CRS_CPP"]
149+
# csvTemplates = ["config_CRS.csv", "config_BerCRS.csv", "config_EWS.csv", "config_RAWMM.csv","config_CPPMM.csv","config_CPPCRS.csv"]
150+
# methodTags = ["CRS", "Ber-CRS", "EWS", "MM","MM_CPP","CRS_CPP"]
151151
elapsedTimeAll, cacheMissAll, periodAll = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
152152
reRun)
153153
groupLine.DrawFigure(periodAll, elapsedTimeAll,

‎benchmark/scripts/scanThreads/drawTogether.py‎

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def readResultSingle(singleValue, resultPath):
8080
cacheMiss = readConfig(resultFname, "cacheMiss")
8181
cacheRefs = readConfig(resultFname, "cacheRefs")
8282
froError = readConfig(resultFname, "froError")
83-
errorBoundRatio=readConfig(resultFname, "errorBoundRatio")
84-
return elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio
83+
errorBoundRatio = readConfig(resultFname, "errorBoundRatio")
84+
return elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio
8585

8686

8787
def cleanPath(path):
@@ -94,40 +94,41 @@ def readResultVector(singleValueVec, resultPath):
9494
cacheMissVec = []
9595
cacheRefVec = []
9696
froErrorVec = []
97-
errorBoundRatioVec=[]
97+
errorBoundRatioVec = []
9898
for i in singleValueVec:
99-
elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio = readResultSingle(i, resultPath)
99+
elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio = readResultSingle(i, resultPath)
100100
elapseTimeVec.append(float(elapsedTime) / 1000.0)
101101
cacheMissVec.append(float(cacheMiss))
102102
cacheRefVec.append(float(cacheRefs))
103103
froErrorVec.append(float(froError))
104104
errorBoundRatioVec.append(float(errorBoundRatio))
105-
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec),np.array(froErrorVec),np.array(errorBoundRatioVec)
105+
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec), np.array(froErrorVec), np.array(
106+
errorBoundRatioVec)
106107

107108

108109
def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec, reRun=1):
109110
elapsedTimeAll = []
110111
cacheMissAll = []
111112
cacheRefAll = []
112113
periodAll = []
113-
froAll=[]
114-
errorBoundRatioAll=[]
114+
froAll = []
115+
errorBoundRatioAll = []
115116
for i in range(len(csvTemplates)):
116117
resultPath = commonPathBase + resultPaths[i]
117118
if (reRun == 1):
118119
os.system("sudo rm -rf " + resultPath)
119120
os.system("sudo mkdir " + resultPath)
120121
runScanVector(exeSpace, periodVec, resultPath, csvTemplates[i])
121-
elapsedTime, cacheMiss, cacheRef,fro,eb = readResultVector(periodVec, resultPath)
122+
elapsedTime, cacheMiss, cacheRef, fro, eb = readResultVector(periodVec, resultPath)
122123
elapsedTimeAll.append(elapsedTime)
123124
cacheMissAll.append(cacheMiss)
124125
cacheRefAll.append(cacheRef)
125126
periodAll.append(periodVec)
126-
cacheMissRateAll = np.array(cacheMissAll)/np.array(cacheRefAll)*100.0
127+
cacheMissRateAll = np.array(cacheMissAll) / np.array(cacheRefAll) * 100.0
127128
froAll.append(fro)
128129
errorBoundRatioAll.append(eb)
129130
# periodAll.append(periodVec)
130-
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll,np.array(froAll),np.array(errorBoundRatioAll)
131+
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll, np.array(froAll), np.array(errorBoundRatioAll)
131132

132133

133134
def main():
@@ -136,10 +137,10 @@ def main():
136137
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag
137138
configTemplate = exeSpace + "config.csv"
138139
commonBase = resultPath + "/"
139-
resultPaths = ["CRS","MM"]
140-
csvTemplates = ["config_CPPCRS.csv","config_CPPMM.csv"]
141-
evaTypes = ['crs-cpp','mm-cpp']
142-
valueVec = [1,2, 4, 6, 8, 10, 12]
140+
resultPaths = ["CRS", "MM"]
141+
csvTemplates = ["config_CPPCRS.csv", "config_CPPMM.csv"]
142+
evaTypes = ['crs-cpp', 'mm-cpp']
143+
valueVec = [1, 2, 4, 6, 8, 10, 12]
143144
valueVecRun = valueVec
144145
print(configTemplate)
145146
reRun = 0
@@ -155,20 +156,21 @@ def main():
155156
tRows = len(resultPaths)
156157
tCols = len(valueVec)
157158
elapseTimeAllSum = np.zeros((tRows, tCols))
158-
froErroAllSum = np.zeros((tRows, tCols))
159-
errorBoundRatioSum= np.zeros((tRows, tCols))
160-
cacheMissAll=np.zeros((tRows, tCols))
159+
froErroAllSum = np.zeros((tRows, tCols))
160+
errorBoundRatioSum = np.zeros((tRows, tCols))
161+
cacheMissAll = np.zeros((tRows, tCols))
161162
rounds = 10
162163
for i in range(rounds):
163-
elapseTimeAll, ch, periodAll,fro,eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, reRun)
164+
elapseTimeAll, ch, periodAll, fro, eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
165+
reRun)
164166
elapseTimeAllSum = elapseTimeAllSum + elapseTimeAll
165167
froErroAllSum = froErroAllSum + fro
166-
errorBoundRatioSum = errorBoundRatioSum+eb
167-
cacheMissAll=cacheMissAll+ch
168+
errorBoundRatioSum = errorBoundRatioSum + eb
169+
cacheMissAll = cacheMissAll + ch
168170
elapseTimeAllSum = elapseTimeAllSum / float(rounds)
169-
froErroAllSum = froErroAllSum / float(rounds)
170-
errorBoundRatioSum = errorBoundRatioSum/float(rounds)
171-
cacheMissAll=cacheMissAll/float(rounds)
171+
froErroAllSum = froErroAllSum / float(rounds)
172+
errorBoundRatioSum = errorBoundRatioSum / float(rounds)
173+
cacheMissAll = cacheMissAll / float(rounds)
172174
# evaTypes = ['FDAMM', 'MM', 'Co-FD', 'BCO-FD']
173175

174176
# elapseTimeVecFD, cacheMissVecFD, cacheRefVecFD = readResultVector(valueVecRun, resultPathFDAMM)
@@ -177,24 +179,24 @@ def main():
177179

178180
# os.system("mkdir " + figPath)
179181
groupLine.DrawFigureXYnormal(periodAll,
180-
1/elapseTimeAllSum,
182+
1 / elapseTimeAllSum,
181183
evaTypes,
182-
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/"+"threads" + "_elapsedTime",
184+
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/" + "threads" + "_elapsedTime",
183185
True)
184186
groupLine.DrawFigureXYnormal(periodAll,
185-
froErroAllSum*100.0,
187+
froErroAllSum * 100.0,
186188
evaTypes,
187-
"#threads", "normalized error %", 0, 1, figPath + "/"+"threads" + "_froError",
189+
"#threads", "normalized error %", 0, 1, figPath + "/" + "threads" + "_froError",
188190
True)
189191
groupLine.DrawFigureXYnormal(periodAll,
190-
errorBoundRatioSum*100.0,
192+
errorBoundRatioSum * 100.0,
191193
evaTypes,
192-
"#threads", "error bound ratio %", 0, 1, figPath + "/"+"threads" + "_ebRatio",
194+
"#threads", "error bound ratio %", 0, 1, figPath + "/" + "threads" + "_ebRatio",
193195
True)
194196
groupLine.DrawFigureXYnormal(periodAll,
195-
cacheMissAll,
197+
cacheMissAll,
196198
evaTypes,
197-
"#threads", "cache miss %", 0, 1, figPath + "/"+"threads" + "_cachemiss",
199+
"#threads", "cache miss %", 0, 1, figPath + "/" + "threads" + "_cachemiss",
198200
True)
199201
# draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,errVec,"95% Latency (ms)","Error","ms","",figPath+"wm_lat")
200202
# draw2yLine("watermark time (ms)",singleValueVecDisp,thrVec,errVec,"Throughput (KTp/s)","Error","KTp/s","",figPath+"wm_thr")

‎benchmark/scripts/scanThreadsBackup/drawTogether.py‎

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def readResultSingle(singleValue, resultPath):
8080
cacheMiss = readConfig(resultFname, "cacheMiss")
8181
cacheRefs = readConfig(resultFname, "cacheRefs")
8282
froError = readConfig(resultFname, "froError")
83-
errorBoundRatio=readConfig(resultFname, "errorBoundRatio")
84-
return elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio
83+
errorBoundRatio = readConfig(resultFname, "errorBoundRatio")
84+
return elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio
8585

8686

8787
def cleanPath(path):
@@ -94,31 +94,32 @@ def readResultVector(singleValueVec, resultPath):
9494
cacheMissVec = []
9595
cacheRefVec = []
9696
froErrorVec = []
97-
errorBoundRatioVec=[]
97+
errorBoundRatioVec = []
9898
for i in singleValueVec:
99-
elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio = readResultSingle(i, resultPath)
99+
elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio = readResultSingle(i, resultPath)
100100
elapseTimeVec.append(float(elapsedTime) / 1000.0)
101101
cacheMissVec.append(float(cacheMiss))
102102
cacheRefVec.append(float(cacheRefs))
103103
froErrorVec.append(float(froError))
104104
errorBoundRatioVec.append(float(errorBoundRatio))
105-
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec),np.array(froErrorVec),np.array(errorBoundRatioVec)
105+
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec), np.array(froErrorVec), np.array(
106+
errorBoundRatioVec)
106107

107108

108109
def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec, reRun=1):
109110
elapsedTimeAll = []
110111
cacheMissAll = []
111112
cacheRefAll = []
112113
periodAll = []
113-
froAll=[]
114-
errorBoundRatioAll=[]
114+
froAll = []
115+
errorBoundRatioAll = []
115116
for i in range(len(csvTemplates)):
116117
resultPath = commonPathBase + resultPaths[i]
117118
if (reRun == 1):
118119
os.system("sudo rm -rf " + resultPath)
119120
os.system("sudo mkdir " + resultPath)
120121
runScanVector(exeSpace, periodVec, resultPath, csvTemplates[i])
121-
elapsedTime, cacheMiss, cacheRef,fro,eb = readResultVector(periodVec, resultPath)
122+
elapsedTime, cacheMiss, cacheRef, fro, eb = readResultVector(periodVec, resultPath)
122123
elapsedTimeAll.append(elapsedTime)
123124
cacheMissAll.append(cacheMiss)
124125
cacheRefAll.append(cacheRef)
@@ -127,7 +128,7 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec
127128
froAll.append(fro)
128129
errorBoundRatioAll.append(eb)
129130
# periodAll.append(periodVec)
130-
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll,np.array(froAll),np.array(errorBoundRatioAll)
131+
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll, np.array(froAll), np.array(errorBoundRatioAll)
131132

132133

133134
def main():
@@ -136,9 +137,9 @@ def main():
136137
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag
137138
configTemplate = exeSpace + "config.csv"
138139
commonBase = resultPath + "/"
139-
resultPaths = ["CRS","CRSRAW","MM","MMRAW"]
140-
csvTemplates = ["config_CPPCRS.csv","config_CRS.csv","config_RAWMM.csv","config_CPPMM.csv"]
141-
evaTypes = ['crs-cpp','crs-pt','mm-pt','mm-cpp']
140+
resultPaths = ["CRS", "CRSRAW", "MM", "MMRAW"]
141+
csvTemplates = ["config_CPPCRS.csv", "config_CRS.csv", "config_RAWMM.csv", "config_CPPMM.csv"]
142+
evaTypes = ['crs-cpp', 'crs-pt', 'mm-pt', 'mm-cpp']
142143
valueVec = [2, 4, 6, 8, 10, 12]
143144
valueVecRun = valueVec
144145
print(configTemplate)
@@ -155,17 +156,18 @@ def main():
155156
tRows = len(resultPaths)
156157
tCols = len(valueVec)
157158
elapseTimeAllSum = np.zeros((tRows, tCols))
158-
froErroAllSum = np.zeros((tRows, tCols))
159-
errorBoundRatioSum= np.zeros((tRows, tCols))
159+
froErroAllSum = np.zeros((tRows, tCols))
160+
errorBoundRatioSum = np.zeros((tRows, tCols))
160161
rounds = 1
161162
for i in range(rounds):
162-
elapseTimeAll, ch, periodAll,fro,eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, reRun)
163+
elapseTimeAll, ch, periodAll, fro, eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
164+
reRun)
163165
elapseTimeAllSum = elapseTimeAllSum + elapseTimeAll
164166
froErroAllSum = froErroAllSum + fro
165-
errorBoundRatioSum = errorBoundRatioSum+eb
167+
errorBoundRatioSum = errorBoundRatioSum + eb
166168
elapseTimeAllSum = elapseTimeAllSum / float(rounds)
167-
froErroAllSum = froErroAllSum / float(rounds)
168-
errorBoundRatioSum = errorBoundRatioSum/float(rounds)
169+
froErroAllSum = froErroAllSum / float(rounds)
170+
errorBoundRatioSum = errorBoundRatioSum / float(rounds)
169171
# evaTypes = ['FDAMM', 'MM', 'Co-FD', 'BCO-FD']
170172

171173
# elapseTimeVecFD, cacheMissVecFD, cacheRefVecFD = readResultVector(valueVecRun, resultPathFDAMM)
@@ -174,19 +176,19 @@ def main():
174176

175177
# os.system("mkdir " + figPath)
176178
groupLine.DrawFigureXYnormal(periodAll,
177-
1/elapseTimeAllSum,
179+
1 / elapseTimeAllSum,
178180
evaTypes,
179-
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/"+"threads" + "_elapsedTime",
181+
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/" + "threads" + "_elapsedTime",
180182
True)
181183
groupLine.DrawFigureXYnormal(periodAll,
182-
froErroAllSum*100.0,
184+
froErroAllSum * 100.0,
183185
evaTypes,
184-
"#threads", "normalized error %", 0, 1, figPath + "/"+"threads" + "_froError",
186+
"#threads", "normalized error %", 0, 1, figPath + "/" + "threads" + "_froError",
185187
True)
186188
groupLine.DrawFigureXYnormal(periodAll,
187-
errorBoundRatioSum*100.0,
189+
errorBoundRatioSum * 100.0,
188190
evaTypes,
189-
"#threads", "error bound ratio %", 0, 1, figPath + "/"+"threads" + "_ebRatio",
191+
"#threads", "error bound ratio %", 0, 1, figPath + "/" + "threads" + "_ebRatio",
190192
True)
191193
# draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,errVec,"95% Latency (ms)","Error","ms","",figPath+"wm_lat")
192194
# draw2yLine("watermark time (ms)",singleValueVecDisp,thrVec,errVec,"Throughput (KTp/s)","Error","KTp/s","",figPath+"wm_thr")

0 commit comments

Comments
 (0)