Skip to content
Merged

Sbug #30

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions benchmark/scripts/scanAColCPP/drawTogether.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec
def main():
exeSpace = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/"
commonBase = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/results/" + scanTag + "/"
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag+"CPP"
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag + "CPP"
methodTags = ["FD-AMM", "Co-AMM", "BCo-AMM", "Couter-sketch", "MM"]
resultPaths = ["fd", "co", "co", "cs", "mm"]
csvTemplates = ["config_FDAMM.csv", "config_CoAMM.csv", "config_BCoAMM.csv", "config_CounterSketch.csv",
Expand All @@ -139,11 +139,11 @@ def main():
os.system("sudo rm -rf " + commonBase)
os.system("sudo mkdir " + commonBase)
reRun = 1

# sampling
resultPaths = ["crs-cpp", "mm-cpp"]
csvTemplates = ["config_CPPCRS.csv", "config_CPPMM.csv"]
methodTags = ["crs-cpp","mm-cpp"]
methodTags = ["crs-cpp", "mm-cpp"]
elapsedTimeAll, cacheMissAll, periodAll = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
reRun)
groupLine.DrawFigure(periodAll, elapsedTimeAll,
Expand Down
16 changes: 8 additions & 8 deletions benchmark/scripts/scanARowCPP/drawTogether.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec
def main():
exeSpace = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/"
commonBase = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/results/" + scanTag + "/"
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag+"CPP"
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag + "CPP"
methodTags = ["FD-AMM", "Co-AMM", "BCo-AMM", "Couter-sketch", "MM"]
resultPaths = ["fd", "co", "co", "cs", "mm"]
csvTemplates = ["config_FDAMM.csv", "config_CoAMM.csv", "config_BCoAMM.csv", "config_CounterSketch.csv",
"config_RAWMM.csv"]
valueVec = [100,200,500,1000,5000, 10000, 20000, 50000,100000]
valueVec = [100, 200, 500, 1000, 5000, 10000, 20000, 50000, 100000]
valueVecDisp = np.array(valueVec)
# run
reRun = 0
Expand All @@ -142,12 +142,12 @@ def main():
# skech

# sampling
#resultPaths = ["crs", "bcrs", "ews", "mm","mm-cpp","crs-cpp"]
resultPaths = ["mm-cpp","crs-cpp"]
csvTemplates = ["config_CPPMM.csv","config_CPPCRS.csv"]
methodTags = ["MM_CPP","CRS_CPP"]
#csvTemplates = ["config_CRS.csv", "config_BerCRS.csv", "config_EWS.csv", "config_RAWMM.csv","config_CPPMM.csv","config_CPPCRS.csv"]
#methodTags = ["CRS", "Ber-CRS", "EWS", "MM","MM_CPP","CRS_CPP"]
# resultPaths = ["crs", "bcrs", "ews", "mm","mm-cpp","crs-cpp"]
resultPaths = ["mm-cpp", "crs-cpp"]
csvTemplates = ["config_CPPMM.csv", "config_CPPCRS.csv"]
methodTags = ["MM_CPP", "CRS_CPP"]
# csvTemplates = ["config_CRS.csv", "config_BerCRS.csv", "config_EWS.csv", "config_RAWMM.csv","config_CPPMM.csv","config_CPPCRS.csv"]
# methodTags = ["CRS", "Ber-CRS", "EWS", "MM","MM_CPP","CRS_CPP"]
elapsedTimeAll, cacheMissAll, periodAll = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
reRun)
groupLine.DrawFigure(periodAll, elapsedTimeAll,
Expand Down
64 changes: 33 additions & 31 deletions benchmark/scripts/scanThreads/drawTogether.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def readResultSingle(singleValue, resultPath):
cacheMiss = readConfig(resultFname, "cacheMiss")
cacheRefs = readConfig(resultFname, "cacheRefs")
froError = readConfig(resultFname, "froError")
errorBoundRatio=readConfig(resultFname, "errorBoundRatio")
return elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio
errorBoundRatio = readConfig(resultFname, "errorBoundRatio")
return elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio


def cleanPath(path):
Expand All @@ -94,40 +94,41 @@ def readResultVector(singleValueVec, resultPath):
cacheMissVec = []
cacheRefVec = []
froErrorVec = []
errorBoundRatioVec=[]
errorBoundRatioVec = []
for i in singleValueVec:
elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio = readResultSingle(i, resultPath)
elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio = readResultSingle(i, resultPath)
elapseTimeVec.append(float(elapsedTime) / 1000.0)
cacheMissVec.append(float(cacheMiss))
cacheRefVec.append(float(cacheRefs))
froErrorVec.append(float(froError))
errorBoundRatioVec.append(float(errorBoundRatio))
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec),np.array(froErrorVec),np.array(errorBoundRatioVec)
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec), np.array(froErrorVec), np.array(
errorBoundRatioVec)


def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec, reRun=1):
elapsedTimeAll = []
cacheMissAll = []
cacheRefAll = []
periodAll = []
froAll=[]
errorBoundRatioAll=[]
froAll = []
errorBoundRatioAll = []
for i in range(len(csvTemplates)):
resultPath = commonPathBase + resultPaths[i]
if (reRun == 1):
os.system("sudo rm -rf " + resultPath)
os.system("sudo mkdir " + resultPath)
runScanVector(exeSpace, periodVec, resultPath, csvTemplates[i])
elapsedTime, cacheMiss, cacheRef,fro,eb = readResultVector(periodVec, resultPath)
elapsedTime, cacheMiss, cacheRef, fro, eb = readResultVector(periodVec, resultPath)
elapsedTimeAll.append(elapsedTime)
cacheMissAll.append(cacheMiss)
cacheRefAll.append(cacheRef)
periodAll.append(periodVec)
cacheMissRateAll = np.array(cacheMissAll)/np.array(cacheRefAll)*100.0
cacheMissRateAll = np.array(cacheMissAll) / np.array(cacheRefAll) * 100.0
froAll.append(fro)
errorBoundRatioAll.append(eb)
# periodAll.append(periodVec)
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll,np.array(froAll),np.array(errorBoundRatioAll)
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll, np.array(froAll), np.array(errorBoundRatioAll)


def main():
Expand All @@ -136,10 +137,10 @@ def main():
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag
configTemplate = exeSpace + "config.csv"
commonBase = resultPath + "/"
resultPaths = ["CRS","MM"]
csvTemplates = ["config_CPPCRS.csv","config_CPPMM.csv"]
evaTypes = ['crs-cpp','mm-cpp']
valueVec = [1,2, 4, 6, 8, 10, 12]
resultPaths = ["CRS", "MM"]
csvTemplates = ["config_CPPCRS.csv", "config_CPPMM.csv"]
evaTypes = ['crs-cpp', 'mm-cpp']
valueVec = [1, 2, 4, 6, 8, 10, 12]
valueVecRun = valueVec
print(configTemplate)
reRun = 0
Expand All @@ -155,20 +156,21 @@ def main():
tRows = len(resultPaths)
tCols = len(valueVec)
elapseTimeAllSum = np.zeros((tRows, tCols))
froErroAllSum = np.zeros((tRows, tCols))
errorBoundRatioSum= np.zeros((tRows, tCols))
cacheMissAll=np.zeros((tRows, tCols))
froErroAllSum = np.zeros((tRows, tCols))
errorBoundRatioSum = np.zeros((tRows, tCols))
cacheMissAll = np.zeros((tRows, tCols))
rounds = 10
for i in range(rounds):
elapseTimeAll, ch, periodAll,fro,eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, reRun)
elapseTimeAll, ch, periodAll, fro, eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
reRun)
elapseTimeAllSum = elapseTimeAllSum + elapseTimeAll
froErroAllSum = froErroAllSum + fro
errorBoundRatioSum = errorBoundRatioSum+eb
cacheMissAll=cacheMissAll+ch
errorBoundRatioSum = errorBoundRatioSum + eb
cacheMissAll = cacheMissAll + ch
elapseTimeAllSum = elapseTimeAllSum / float(rounds)
froErroAllSum = froErroAllSum / float(rounds)
errorBoundRatioSum = errorBoundRatioSum/float(rounds)
cacheMissAll=cacheMissAll/float(rounds)
froErroAllSum = froErroAllSum / float(rounds)
errorBoundRatioSum = errorBoundRatioSum / float(rounds)
cacheMissAll = cacheMissAll / float(rounds)
# evaTypes = ['FDAMM', 'MM', 'Co-FD', 'BCO-FD']

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

# os.system("mkdir " + figPath)
groupLine.DrawFigureXYnormal(periodAll,
1/elapseTimeAllSum,
1 / elapseTimeAllSum,
evaTypes,
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/"+"threads" + "_elapsedTime",
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/" + "threads" + "_elapsedTime",
True)
groupLine.DrawFigureXYnormal(periodAll,
froErroAllSum*100.0,
froErroAllSum * 100.0,
evaTypes,
"#threads", "normalized error %", 0, 1, figPath + "/"+"threads" + "_froError",
"#threads", "normalized error %", 0, 1, figPath + "/" + "threads" + "_froError",
True)
groupLine.DrawFigureXYnormal(periodAll,
errorBoundRatioSum*100.0,
errorBoundRatioSum * 100.0,
evaTypes,
"#threads", "error bound ratio %", 0, 1, figPath + "/"+"threads" + "_ebRatio",
"#threads", "error bound ratio %", 0, 1, figPath + "/" + "threads" + "_ebRatio",
True)
groupLine.DrawFigureXYnormal(periodAll,
cacheMissAll,
cacheMissAll,
evaTypes,
"#threads", "cache miss %", 0, 1, figPath + "/"+"threads" + "_cachemiss",
"#threads", "cache miss %", 0, 1, figPath + "/" + "threads" + "_cachemiss",
True)
# draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,errVec,"95% Latency (ms)","Error","ms","",figPath+"wm_lat")
# draw2yLine("watermark time (ms)",singleValueVecDisp,thrVec,errVec,"Throughput (KTp/s)","Error","KTp/s","",figPath+"wm_thr")
Expand Down
50 changes: 26 additions & 24 deletions benchmark/scripts/scanThreadsBackup/drawTogether.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def readResultSingle(singleValue, resultPath):
cacheMiss = readConfig(resultFname, "cacheMiss")
cacheRefs = readConfig(resultFname, "cacheRefs")
froError = readConfig(resultFname, "froError")
errorBoundRatio=readConfig(resultFname, "errorBoundRatio")
return elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio
errorBoundRatio = readConfig(resultFname, "errorBoundRatio")
return elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio


def cleanPath(path):
Expand All @@ -94,31 +94,32 @@ def readResultVector(singleValueVec, resultPath):
cacheMissVec = []
cacheRefVec = []
froErrorVec = []
errorBoundRatioVec=[]
errorBoundRatioVec = []
for i in singleValueVec:
elapsedTime, cacheMiss, cacheRefs,froError,errorBoundRatio = readResultSingle(i, resultPath)
elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio = readResultSingle(i, resultPath)
elapseTimeVec.append(float(elapsedTime) / 1000.0)
cacheMissVec.append(float(cacheMiss))
cacheRefVec.append(float(cacheRefs))
froErrorVec.append(float(froError))
errorBoundRatioVec.append(float(errorBoundRatio))
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec),np.array(froErrorVec),np.array(errorBoundRatioVec)
return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec), np.array(froErrorVec), np.array(
errorBoundRatioVec)


def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec, reRun=1):
elapsedTimeAll = []
cacheMissAll = []
cacheRefAll = []
periodAll = []
froAll=[]
errorBoundRatioAll=[]
froAll = []
errorBoundRatioAll = []
for i in range(len(csvTemplates)):
resultPath = commonPathBase + resultPaths[i]
if (reRun == 1):
os.system("sudo rm -rf " + resultPath)
os.system("sudo mkdir " + resultPath)
runScanVector(exeSpace, periodVec, resultPath, csvTemplates[i])
elapsedTime, cacheMiss, cacheRef,fro,eb = readResultVector(periodVec, resultPath)
elapsedTime, cacheMiss, cacheRef, fro, eb = readResultVector(periodVec, resultPath)
elapsedTimeAll.append(elapsedTime)
cacheMissAll.append(cacheMiss)
cacheRefAll.append(cacheRef)
Expand All @@ -127,7 +128,7 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec
froAll.append(fro)
errorBoundRatioAll.append(eb)
# periodAll.append(periodVec)
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll,np.array(froAll),np.array(errorBoundRatioAll)
return np.array(elapsedTimeAll), cacheMissRateAll, periodAll, np.array(froAll), np.array(errorBoundRatioAll)


def main():
Expand All @@ -136,9 +137,9 @@ def main():
figPath = os.path.abspath(os.path.join(os.getcwd(), "../..")) + "/figures/" + scanTag
configTemplate = exeSpace + "config.csv"
commonBase = resultPath + "/"
resultPaths = ["CRS","CRSRAW","MM","MMRAW"]
csvTemplates = ["config_CPPCRS.csv","config_CRS.csv","config_RAWMM.csv","config_CPPMM.csv"]
evaTypes = ['crs-cpp','crs-pt','mm-pt','mm-cpp']
resultPaths = ["CRS", "CRSRAW", "MM", "MMRAW"]
csvTemplates = ["config_CPPCRS.csv", "config_CRS.csv", "config_RAWMM.csv", "config_CPPMM.csv"]
evaTypes = ['crs-cpp', 'crs-pt', 'mm-pt', 'mm-cpp']
valueVec = [2, 4, 6, 8, 10, 12]
valueVecRun = valueVec
print(configTemplate)
Expand All @@ -155,17 +156,18 @@ def main():
tRows = len(resultPaths)
tCols = len(valueVec)
elapseTimeAllSum = np.zeros((tRows, tCols))
froErroAllSum = np.zeros((tRows, tCols))
errorBoundRatioSum= np.zeros((tRows, tCols))
froErroAllSum = np.zeros((tRows, tCols))
errorBoundRatioSum = np.zeros((tRows, tCols))
rounds = 1
for i in range(rounds):
elapseTimeAll, ch, periodAll,fro,eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, reRun)
elapseTimeAll, ch, periodAll, fro, eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec,
reRun)
elapseTimeAllSum = elapseTimeAllSum + elapseTimeAll
froErroAllSum = froErroAllSum + fro
errorBoundRatioSum = errorBoundRatioSum+eb
errorBoundRatioSum = errorBoundRatioSum + eb
elapseTimeAllSum = elapseTimeAllSum / float(rounds)
froErroAllSum = froErroAllSum / float(rounds)
errorBoundRatioSum = errorBoundRatioSum/float(rounds)
froErroAllSum = froErroAllSum / float(rounds)
errorBoundRatioSum = errorBoundRatioSum / float(rounds)
# evaTypes = ['FDAMM', 'MM', 'Co-FD', 'BCO-FD']

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

# os.system("mkdir " + figPath)
groupLine.DrawFigureXYnormal(periodAll,
1/elapseTimeAllSum,
1 / elapseTimeAllSum,
evaTypes,
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/"+"threads" + "_elapsedTime",
"#threads", "1/elapsed time (1/ms)", 0, 1, figPath + "/" + "threads" + "_elapsedTime",
True)
groupLine.DrawFigureXYnormal(periodAll,
froErroAllSum*100.0,
froErroAllSum * 100.0,
evaTypes,
"#threads", "normalized error %", 0, 1, figPath + "/"+"threads" + "_froError",
"#threads", "normalized error %", 0, 1, figPath + "/" + "threads" + "_froError",
True)
groupLine.DrawFigureXYnormal(periodAll,
errorBoundRatioSum*100.0,
errorBoundRatioSum * 100.0,
evaTypes,
"#threads", "error bound ratio %", 0, 1, figPath + "/"+"threads" + "_ebRatio",
"#threads", "error bound ratio %", 0, 1, figPath + "/" + "threads" + "_ebRatio",
True)
# draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,errVec,"95% Latency (ms)","Error","ms","",figPath+"wm_lat")
# draw2yLine("watermark time (ms)",singleValueVecDisp,thrVec,errVec,"Throughput (KTp/s)","Error","KTp/s","",figPath+"wm_thr")
Expand Down
Loading