@@ -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
8787def 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
108109def 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
133134def 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")
0 commit comments