- df['nsecperiter']=(df['duration']*1000)/(df['nbiter'])
- stdev = pd.DataFrame({'perevent_stdev' :
- df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['nsecperiter'].std()}).reset_index()
- mean = pd.DataFrame({'perevent_mean' :
- df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['nsecperiter'].mean()}).reset_index()
- mem_mean = pd.DataFrame({'mem_mean' :
- df.groupby(['nbthreads','tracer','testcase','sleeptime'])['maxmem'].mean()}).reset_index()
- mem_stdev = pd.DataFrame({'mem_stdev' :
- df.groupby(['nbthreads','tracer','testcase','sleeptime'])['maxmem'].std()}).reset_index()
- tmp = mean.merge(stdev)
- tmp = tmp.merge(mem_mean)
- tmp = tmp.merge(mem_stdev)
+ # Duration is in usec
+ # usecPecIter = Duration/(average number of iteration per thread)
+ df['usecperiter'] = (df['nbthreads'] * df['duration']) / df['nbiter']
+
+ periter_mean = pd.DataFrame({'periter_mean' :
+ df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['usecperiter'].mean()}).reset_index()
+
+ periter_stdev = pd.DataFrame({'periter_stdev' :
+ df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['usecperiter'].std()}).reset_index()
+
+ nbiter_mean = pd.DataFrame({'nbiter_mean' :
+ df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['nbiter'].mean()}).reset_index()
+
+ nbiter_stdev = pd.DataFrame({'nbiter_stdev' :
+ df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['nbiter'].std()}).reset_index()
+
+ duration_mean = pd.DataFrame({'duration_mean' :
+ df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['duration'].mean()}).reset_index()
+
+ duration_stdev = pd.DataFrame({'duration_stdev' :
+ df.groupby(['nbthreads', 'tracer', 'testcase','sleeptime'])['duration'].std()}).reset_index()
+
+ tmp = periter_mean.merge(periter_stdev)
+
+ tmp = tmp.merge(nbiter_mean)
+ tmp = tmp.merge(nbiter_stdev)
+
+ tmp = tmp.merge(duration_mean)
+ tmp = tmp.merge(duration_stdev)
+
+ # if there is any NaN or None value in the DF we raise an exeception
+ if tmp.isnull().values.any():
+ raise Exception('NaN value found in dataframe')