source: doc/theses/mike_brooks_MMath/plots/string-allocn-attrib-sepcmp.py

Last change on this file was 810c2c5, checked in by Michael Brooks <mlbrooks@…>, 6 days ago

address two string-section oustanding items: remove confusing sentences; add attribution plot overlay for separate compilation overhead

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[810c2c5]1import pandas as pd
2import numpy as np
3import os
4import sys
5from pathlib import Path
6
7sys.path.insert(0, os.path.dirname(__file__))
8from common import *
9
10infile_attrib = os.path.dirname(os.path.abspath(__file__)) + '/../build/plot-string-allocn-attrib.dat'
11attribs = pd.read_csv(infile_attrib,
12 sep='\t',
13 header=0)
14
15infile_sepcmp = os.path.dirname(os.path.abspath(__file__)) + '/../benchmarks/string/string-separate-compilation-overhead.csv'
16sepcmps = pd.read_csv(infile_sepcmp,
17 header=0)
18
19# putting the sepcmp bar at the top of 'other', so just below ctor-dtor
20category_above_semcmp = 'ctor-dtor'
21
22# print(attribs)
23# print(sepcmps)
24
25# print(attribs.columns)
26
27isfirst = True
28
29for _,scr in sepcmps.iterrows():
30 size = scr['size']
31# tuning = r['tuning']
32 attrib_key = attribs[ (attribs['corpus-meanlen-tgt'] == size) &
33 (attribs['sut-platform'] == 'cfa') &
34 ( attribs['category'] == category_above_semcmp )]
35 attrib_key = attrib_key.copy()
36# print(attrib_key)
37 assert( len(attrib_key) == 1 )
38# attrib_key = attrib_key.iloc[0] # convert from singleton table to row
39 attrib_key['sepcmp-Delta'] = scr['mean DeltaOpDur']
40 attrib_key['sepcmp-adjusted'] = attrib_key['grp-prior-duration-ns'] - attrib_key['sepcmp-Delta']
41
42 print(attrib_key.to_csv(header=isfirst, index=False, sep='\t', na_rep="0"), end='')
43 isfirst = False
44
Note: See TracBrowser for help on using the repository browser.