From ce788f7832310165e05e94641c5a105a9de0c72a Mon Sep 17 00:00:00 2001 From: tony <292224750@qq.com> Date: Tue, 6 Jun 2023 10:47:34 +0800 Subject: [PATCH] 1. Update the example scripts in scripts/scanARowCPP and scripts/scanAColCPP --- README.md | 4 +- .../scripts/scanAColCPP/config_CPPCOFD.csv | 10 ++++ .../scanAColCPP/config_CPPCOUNTERSKETCH.csv | 10 ++++ .../scripts/scanAColCPP/config_CPPCRS.csv | 4 +- .../scripts/scanAColCPP/config_CPPEWS.csv | 10 ++++ .../scripts/scanAColCPP/config_CPPMM.csv | 4 +- .../scripts/scanAColCPP/config_CPPTOW.csv | 10 ++++ benchmark/scripts/scanAColCPP/drawTogether.py | 52 ++++++++++++++----- benchmark/scripts/scanAColCPP/groupLine.py | 10 ++-- .../scripts/scanARowCPP/config_CPPCOFD.csv | 10 ++++ .../scanARowCPP/config_CPPCOUNTERSKETCH.csv | 10 ++++ .../scripts/scanARowCPP/config_CPPCRS.csv | 4 +- .../scripts/scanARowCPP/config_CPPEWS.csv | 10 ++++ .../scripts/scanARowCPP/config_CPPMM.csv | 4 +- .../scripts/scanARowCPP/config_CPPTOW.csv | 10 ++++ benchmark/scripts/scanARowCPP/drawTogether.py | 49 ++++++++++++----- benchmark/scripts/scanARowCPP/groupLine.py | 10 ++-- commit.sh | 2 +- commit_info | 3 +- include/CPPAlgos/TugOfWarCPPAlgo.h | 2 +- src/CPPAlgos/CPPAlgoTable.cpp | 4 +- 21 files changed, 187 insertions(+), 45 deletions(-) create mode 100644 benchmark/scripts/scanAColCPP/config_CPPCOFD.csv create mode 100644 benchmark/scripts/scanAColCPP/config_CPPCOUNTERSKETCH.csv create mode 100644 benchmark/scripts/scanAColCPP/config_CPPEWS.csv create mode 100644 benchmark/scripts/scanAColCPP/config_CPPTOW.csv create mode 100644 benchmark/scripts/scanARowCPP/config_CPPCOFD.csv create mode 100644 benchmark/scripts/scanARowCPP/config_CPPCOUNTERSKETCH.csv create mode 100644 benchmark/scripts/scanARowCPP/config_CPPEWS.csv create mode 100644 benchmark/scripts/scanARowCPP/config_CPPTOW.csv diff --git a/README.md b/README.md index 672e35ff..2f0d3da4 100644 --- a/README.md +++ b/README.md @@ -216,4 +216,6 @@ You will find the figures then. 3. Clion may fail to render and highlight the torch apis. In this case, kindly type a random line of "555" to validate the highlight when you need it, and comment it during a compile. :) 4. When setting up torch for cpu under python version > 3.10, torch == 1.13.0 would conflict with torchaudio according - to https://pytorch.org/audio/stable/installation.html. Use Python version <= 3.10 for smooth installation. \ No newline at end of file + to https://pytorch.org/audio/stable/installation.html. Use Python version <= 3.10 for smooth installation. +5. Some heavy-weight algos like co-occurring FD may be treated as a zombie thread by some OS like ubuntu if running in default benchmark program, in this case +, please force them to be executed as a running child thread by setting forceMP(U64)=1 and threads(U64)=1 in config \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/config_CPPCOFD.csv b/benchmark/scripts/scanAColCPP/config_CPPCOFD.csv new file mode 100644 index 00000000..bda5baca --- /dev/null +++ b/benchmark/scripts/scanAColCPP/config_CPPCOFD.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,1000,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/CRS.pt,String +useCPP,1,U64 +cppAlgoTag,cooFD,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/config_CPPCOUNTERSKETCH.csv b/benchmark/scripts/scanAColCPP/config_CPPCOUNTERSKETCH.csv new file mode 100644 index 00000000..26225dd8 --- /dev/null +++ b/benchmark/scripts/scanAColCPP/config_CPPCOUNTERSKETCH.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,1000,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/CRS.pt,String +useCPP,1,U64 +cppAlgoTag,countSketch,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/config_CPPCRS.csv b/benchmark/scripts/scanAColCPP/config_CPPCRS.csv index a9b928d2..54156e97 100644 --- a/benchmark/scripts/scanAColCPP/config_CPPCRS.csv +++ b/benchmark/scripts/scanAColCPP/config_CPPCRS.csv @@ -5,4 +5,6 @@ bCol,500,U64 sketchDimension,25,U64 ptFile,torchscripts/CRS.pt,String useCPP,1,U64 -cppAlgoTag,crs,String \ No newline at end of file +cppAlgoTag,crs,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/config_CPPEWS.csv b/benchmark/scripts/scanAColCPP/config_CPPEWS.csv new file mode 100644 index 00000000..01537900 --- /dev/null +++ b/benchmark/scripts/scanAColCPP/config_CPPEWS.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,1000,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/RAWMM.pt,String +useCPP,1,U64 +cppAlgoTag,ews,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/config_CPPMM.csv b/benchmark/scripts/scanAColCPP/config_CPPMM.csv index 32521595..b4db309a 100644 --- a/benchmark/scripts/scanAColCPP/config_CPPMM.csv +++ b/benchmark/scripts/scanAColCPP/config_CPPMM.csv @@ -5,4 +5,6 @@ bCol,500,U64 sketchDimension,25,U64 ptFile,torchscripts/RAWMM.pt,String useCPP,1,U64 -cppAlgoTag,mm,String \ No newline at end of file +cppAlgoTag,mm,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/config_CPPTOW.csv b/benchmark/scripts/scanAColCPP/config_CPPTOW.csv new file mode 100644 index 00000000..eded86f7 --- /dev/null +++ b/benchmark/scripts/scanAColCPP/config_CPPTOW.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,1000,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/RAWMM.pt,String +useCPP,1,U64 +cppAlgoTag,tugOfWar,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanAColCPP/drawTogether.py b/benchmark/scripts/scanAColCPP/drawTogether.py index 0948bd1b..20d8aa55 100755 --- a/benchmark/scripts/scanAColCPP/drawTogether.py +++ b/benchmark/scripts/scanAColCPP/drawTogether.py @@ -79,7 +79,9 @@ def readResultSingle(singleValue, resultPath): elapsedTime = readConfig(resultFname, "perfElapsedTime") cacheMiss = readConfig(resultFname, "cacheMiss") cacheRefs = readConfig(resultFname, "cacheRefs") - return elapsedTime, cacheMiss, cacheRefs + froError = readConfig(resultFname, "froError") + errorBoundRatio = readConfig(resultFname, "errorBoundRatio") + return elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio def cleanPath(path): @@ -91,12 +93,17 @@ def readResultVector(singleValueVec, resultPath): elapseTimeVec = [] cacheMissVec = [] cacheRefVec = [] + froErrorVec = [] + errorBoundRatioVec = [] for i in singleValueVec: - elapsedTime, cacheMiss, cacheRefs = 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)) - return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec) + froErrorVec.append(float(froError)) + errorBoundRatioVec.append(float(errorBoundRatio)) + 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): @@ -104,20 +111,24 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec cacheMissAll = [] cacheRefAll = [] periodAll = [] + 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 = 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 + froAll.append(fro) + errorBoundRatioAll.append(eb) # periodAll.append(periodVec) - return np.array(elapsedTimeAll), cacheMissRateAll, periodAll + return np.array(elapsedTimeAll), cacheMissRateAll, periodAll, np.array(froAll), np.array(errorBoundRatioAll) def main(): @@ -141,21 +152,36 @@ def main(): reRun = 1 # sampling - resultPaths = ["crs-cpp", "mm-cpp"] - csvTemplates = ["config_CPPCRS.csv", "config_CPPMM.csv"] - methodTags = ["crs-cpp", "mm-cpp"] - elapsedTimeAll, cacheMissAll, periodAll = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, + # sampling + # resultPaths = ["crs", "bcrs", "ews", "mm","mm-cpp","crs-cpp"] + resultPaths = ["mm", "crs","ews","counterSketch","cofd","tow"] + csvTemplates = ["config_CPPMM.csv", "config_CPPCRS.csv","config_CPPEWS.csv","config_CPPCOUNTERSKETCH.csv","config_CPPCOFD.csv","config_CPPTOW.csv"] + methodTags = ["mm", "crs","ews","counterSketch","cofd","tow"] + # 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,fro,eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, reRun) groupLine.DrawFigure(periodAll, elapsedTimeAll, methodTags, - "# A's col", "elapsed time (ms)", 0, 1, - figPath + "/" + scanTag + "sampling_elapsedTime", + "#A's col", "elapsed time (ms)", 0, 1, + figPath + "/" + scanTag + "cpp_elapsedTime", True) groupLine.DrawFigureYnormal(periodAll, cacheMissAll, methodTags, - "# A's col", "cacheMiss (%)", 0, 1, - figPath + "/" + scanTag + "sampling_cacheMiss", + "#A's col", "cacheMiss (%)", 0, 1, + figPath + "/" + scanTag + "cpp_cacheMiss", True) + groupLine.DrawFigureYnormal(periodAll, + fro * 100.0, + methodTags, + "#A's col", "normalized error %", 0, 1, figPath + "/" +scanTag + "_froError", + True) + groupLine.DrawFigureYnormal(periodAll, + eb * 100.0, + methodTags, + "#A's col", "error bound ratio %", 0, 1, figPath + "/" + scanTag + "_ebRatio", + True) + # draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,errVec,"95% Latency (ms)","Error","ms","",figPa # 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") # draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,compVec,"95% Latency (ms)","Completeness","ms","",figPath+"wm_omp") diff --git a/benchmark/scripts/scanAColCPP/groupLine.py b/benchmark/scripts/scanAColCPP/groupLine.py index 8110fd3b..551d40a7 100755 --- a/benchmark/scripts/scanAColCPP/groupLine.py +++ b/benchmark/scripts/scanAColCPP/groupLine.py @@ -208,6 +208,7 @@ def DrawFigureXYnormal(xvalues, yvalues, legend_labels, x_label, y_label, y_min, # plt.show() plt.savefig(filename + ".pdf", bbox_inches='tight') +import matplotlib.ticker as mtick # draw a line chart def DrawFigureYnormal(xvalues, yvalues, legend_labels, x_label, y_label, y_min, y_max, filename, allow_legend): @@ -243,12 +244,14 @@ def DrawFigureYnormal(xvalues, yvalues, legend_labels, x_label, y_label, y_min, # plt.yscale('log') # you may control the limits on your own. - - # plt.ylim(y_min, y_max) + yMax=np.max(y_values) + plt.ylim(y_min, yMax*1.2) plt.grid(axis='y', color='gray') plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 - # figure.yaxis.set_major_locator(LogLocator(base=10)) + figure.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.1f')) + + figure.yaxis.set_major_locator(LinearLocator(numticks=5)) # figure.xaxis.set_major_locator(LogLocator(base=10)) plt.xticks(rotation=0, fontsize=TICK_FONT_SIZE) figure.get_xaxis().set_tick_params(direction='in', pad=10) @@ -264,6 +267,7 @@ def DrawFigureYnormal(xvalues, yvalues, legend_labels, x_label, y_label, y_min, plt.savefig(filename + ".pdf", bbox_inches='tight') + # example for reading csv file def ReadFile(): y = [] diff --git a/benchmark/scripts/scanARowCPP/config_CPPCOFD.csv b/benchmark/scripts/scanARowCPP/config_CPPCOFD.csv new file mode 100644 index 00000000..cf8f066a --- /dev/null +++ b/benchmark/scripts/scanARowCPP/config_CPPCOFD.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,100,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/CRS.pt,String +useCPP,1,U64 +cppAlgoTag,cooFD,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanARowCPP/config_CPPCOUNTERSKETCH.csv b/benchmark/scripts/scanARowCPP/config_CPPCOUNTERSKETCH.csv new file mode 100644 index 00000000..a06776ab --- /dev/null +++ b/benchmark/scripts/scanARowCPP/config_CPPCOUNTERSKETCH.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,100,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/CRS.pt,String +useCPP,1,U64 +cppAlgoTag,countSketch,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanARowCPP/config_CPPCRS.csv b/benchmark/scripts/scanARowCPP/config_CPPCRS.csv index d870c50f..a14312fa 100644 --- a/benchmark/scripts/scanARowCPP/config_CPPCRS.csv +++ b/benchmark/scripts/scanARowCPP/config_CPPCRS.csv @@ -5,4 +5,6 @@ bCol,500,U64 sketchDimension,25,U64 ptFile,torchscripts/CRS.pt,String useCPP,1,U64 -cppAlgoTag,crs,String \ No newline at end of file +cppAlgoTag,crs,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanARowCPP/config_CPPEWS.csv b/benchmark/scripts/scanARowCPP/config_CPPEWS.csv new file mode 100644 index 00000000..1b472672 --- /dev/null +++ b/benchmark/scripts/scanARowCPP/config_CPPEWS.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,100,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/RAWMM.pt,String +useCPP,1,U64 +cppAlgoTag,ews,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanARowCPP/config_CPPMM.csv b/benchmark/scripts/scanARowCPP/config_CPPMM.csv index ac763201..e1b44e10 100644 --- a/benchmark/scripts/scanARowCPP/config_CPPMM.csv +++ b/benchmark/scripts/scanARowCPP/config_CPPMM.csv @@ -5,4 +5,6 @@ bCol,500,U64 sketchDimension,25,U64 ptFile,torchscripts/RAWMM.pt,String useCPP,1,U64 -cppAlgoTag,mm,String \ No newline at end of file +cppAlgoTag,mm,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanARowCPP/config_CPPTOW.csv b/benchmark/scripts/scanARowCPP/config_CPPTOW.csv new file mode 100644 index 00000000..d72e3a6f --- /dev/null +++ b/benchmark/scripts/scanARowCPP/config_CPPTOW.csv @@ -0,0 +1,10 @@ +key,value,type +aRow,100,U64 +aCol,1000,U64 +bCol,500,U64 +sketchDimension,25,U64 +ptFile,torchscripts/RAWMM.pt,String +useCPP,1,U64 +cppAlgoTag,tugOfWar,String +threads,1,U64 +forceMP,1,U64 \ No newline at end of file diff --git a/benchmark/scripts/scanARowCPP/drawTogether.py b/benchmark/scripts/scanARowCPP/drawTogether.py index 2d77db57..c67ec677 100755 --- a/benchmark/scripts/scanARowCPP/drawTogether.py +++ b/benchmark/scripts/scanARowCPP/drawTogether.py @@ -79,7 +79,9 @@ def readResultSingle(singleValue, resultPath): elapsedTime = readConfig(resultFname, "perfElapsedTime") cacheMiss = readConfig(resultFname, "cacheMiss") cacheRefs = readConfig(resultFname, "cacheRefs") - return elapsedTime, cacheMiss, cacheRefs + froError = readConfig(resultFname, "froError") + errorBoundRatio = readConfig(resultFname, "errorBoundRatio") + return elapsedTime, cacheMiss, cacheRefs, froError, errorBoundRatio def cleanPath(path): @@ -91,12 +93,17 @@ def readResultVector(singleValueVec, resultPath): elapseTimeVec = [] cacheMissVec = [] cacheRefVec = [] + froErrorVec = [] + errorBoundRatioVec = [] for i in singleValueVec: - elapsedTime, cacheMiss, cacheRefs = 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)) - return np.array(elapseTimeVec), np.array(cacheMissVec), np.array(cacheRefVec) + froErrorVec.append(float(froError)) + errorBoundRatioVec.append(float(errorBoundRatio)) + 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): @@ -104,20 +111,24 @@ def compareMethod(exeSpace, commonPathBase, resultPaths, csvTemplates, periodVec cacheMissAll = [] cacheRefAll = [] periodAll = [] + 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 = 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 + froAll.append(fro) + errorBoundRatioAll.append(eb) # periodAll.append(periodVec) - return np.array(elapsedTimeAll), cacheMissRateAll, periodAll + return np.array(elapsedTimeAll), cacheMissRateAll, periodAll, np.array(froAll), np.array(errorBoundRatioAll) def main(): @@ -143,23 +154,33 @@ def main(): # 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"] + resultPaths = ["mm", "crs","ews","counterSketch","cofd","tow"] + csvTemplates = ["config_CPPMM.csv", "config_CPPCRS.csv","config_CPPEWS.csv","config_CPPCOUNTERSKETCH.csv","config_CPPCOFD.csv","config_CPPTOW.csv"] + methodTags = ["mm", "crs","ews","counterSketch","cofd","tow"] # 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, + # methodTags = ["CRS", "Ber-CRS", "EWS",, "MM","MM_CPP","CRS_CPP"] + elapsedTimeAll, cacheMissAll, periodAll,fro,eb = compareMethod(exeSpace, commonBase, resultPaths, csvTemplates, valueVec, reRun) groupLine.DrawFigure(periodAll, elapsedTimeAll, methodTags, - "#elements in A's row", "elapsed time (ms)", 0, 1, - figPath + "/" + scanTag + "sampling_elapsedTime", + "#A's row", "elapsed time (ms)", 0, 1, + figPath + "/" + scanTag + "cpp_elapsedTime", True) groupLine.DrawFigureYnormal(periodAll, cacheMissAll, methodTags, - "#elements in A's row", "cacheMiss (%)", 0, 1, - figPath + "/" + scanTag + "sampling_cacheMiss", + "#A's row", "cacheMiss (%)", 0, 100, + figPath + "/" + scanTag + "cpp_cacheMiss", True) + groupLine.DrawFigureYnormal(periodAll, + fro * 100.0, + methodTags, + "#A's row", "normalized error %", 0, 100, figPath + "/" +scanTag + "_froError", + True) + groupLine.DrawFigureYnormal(periodAll, + eb * 100.0, + methodTags, + "#A's row", "error bound ratio %", 0, 100, figPath + "/" + scanTag + "_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") # draw2yLine("watermark time (ms)",singleValueVecDisp,lat95Vec,compVec,"95% Latency (ms)","Completeness","ms","",figPath+"wm_omp") diff --git a/benchmark/scripts/scanARowCPP/groupLine.py b/benchmark/scripts/scanARowCPP/groupLine.py index 8110fd3b..77993fc1 100755 --- a/benchmark/scripts/scanARowCPP/groupLine.py +++ b/benchmark/scripts/scanARowCPP/groupLine.py @@ -10,7 +10,7 @@ from matplotlib.font_manager import FontProperties from matplotlib.ticker import LinearLocator, LogLocator, MaxNLocator, ScalarFormatter from numpy import double - +import matplotlib.ticker as mtick # 获取系统中可用的字体路径 # font_paths = fm.findSystemFonts() # OPT_FONT_NAME = 'Helvetica' @@ -243,12 +243,14 @@ def DrawFigureYnormal(xvalues, yvalues, legend_labels, x_label, y_label, y_min, # plt.yscale('log') # you may control the limits on your own. - - # plt.ylim(y_min, y_max) + yMax=np.max(y_values) + plt.ylim(y_min, yMax*1.2) plt.grid(axis='y', color='gray') plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 - # figure.yaxis.set_major_locator(LogLocator(base=10)) + figure.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.1f')) + + figure.yaxis.set_major_locator(LinearLocator(numticks=5)) # figure.xaxis.set_major_locator(LogLocator(base=10)) plt.xticks(rotation=0, fontsize=TICK_FONT_SIZE) figure.get_xaxis().set_tick_params(direction='in', pad=10) diff --git a/commit.sh b/commit.sh index 98040b2a..17cba7b4 100755 --- a/commit.sh +++ b/commit.sh @@ -1,4 +1,4 @@ -BRANCH=sbug +BRANCH=NIGHTLY_TEST git init git checkout -b $BRANCH git add . diff --git a/commit_info b/commit_info index e484c1b8..fbf0b8a6 100644 --- a/commit_info +++ b/commit_info @@ -1,2 +1 @@ -1. fix the uint64_t bugs -2. Note; please note the int8 is just a toy \ No newline at end of file +1. Update the example scripts in scripts/scanARowCPP and scripts/scanAColCPP \ No newline at end of file diff --git a/include/CPPAlgos/TugOfWarCPPAlgo.h b/include/CPPAlgos/TugOfWarCPPAlgo.h index 198c8e94..f21cfbbf 100644 --- a/include/CPPAlgos/TugOfWarCPPAlgo.h +++ b/include/CPPAlgos/TugOfWarCPPAlgo.h @@ -14,7 +14,7 @@ namespace AMMBench { */ /** * @class CRSCPPlgo CPPAlgos/TugOfWarCPPAlgo.h - * @brief The cloumn row sampling (CRS) class of c++ algos + * @brief The tug of war class of c++ algos * */ class TugOfWarCPPAlgo : public AMMBench::AbstractCPPAlgo { diff --git a/src/CPPAlgos/CPPAlgoTable.cpp b/src/CPPAlgos/CPPAlgoTable.cpp index 9d7f3ad7..77ffb5e5 100644 --- a/src/CPPAlgos/CPPAlgoTable.cpp +++ b/src/CPPAlgos/CPPAlgoTable.cpp @@ -24,10 +24,10 @@ AMMBench::CPPAlgoTable::CPPAlgoTable() { algoMap["countSketch"] = newCountSketchCPPAlgo(); algoMap["bcrs"] = newBCRSCPPAlgo(); algoMap["ews"] = newEWSCPPAlgo(); - algoMap["CoOFD"] = newCoOccurringFDCPPAlgo(); + algoMap["cooFD"] = newCoOccurringFDCPPAlgo(); algoMap["bcoofd"] = newBetaCoOFDCPPAlgo(); algoMap["int8"] = newINT8CPPAlgo(); - algoMap["tug-of-war"] = newTugOfWarCPPAlgo(); + algoMap["tugOfWar"] = newTugOfWarCPPAlgo(); } } // AMMBench