Changeset e0350e0 for doc/theses/mike_brooks_MMath/plots
- Timestamp:
- Jun 4, 2025, 1:43:34 PM (4 months ago)
- Branches:
- master
- Children:
- f858ca5
- Parents:
- c8bdbaf
- Location:
- doc/theses/mike_brooks_MMath/plots
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/plots/common.py
rc8bdbaf re0350e0 17 17 18 18 dt[['corpus-basename', 19 'corpus-ext']] = dt['corpus'].str.strip().str. split('.', expand=True)19 'corpus-ext']] = dt['corpus'].str.strip().str.rsplit('.', n=1, expand=True) 20 20 dt[['corpus-slug', 21 'corpus-nstrs ',22 'corpus-meanlen ',21 'corpus-nstrs-tgt', 22 'corpus-meanlen-tgt', 23 23 'corpus-runid']] = dt['corpus-basename'].str.strip().str.split('-', expand=True) 24 dt["corpus-nstrs"] = pd.to_numeric(dt["corpus-nstrs"]) 25 dt["corpus-meanlen"] = pd.to_numeric(dt["corpus-meanlen"]) 26 dt["corpus-runid"] = pd.to_numeric(dt["corpus-runid"]) 24 dt["corpus-nstrs-tgt"] = pd.to_numeric(dt["corpus-nstrs-tgt"]) 25 dt["corpus-meanlen-tgt"] = pd.to_numeric(dt["corpus-meanlen-tgt"]) 26 dt[['corpus-relscale', 27 'corpus-seed', 28 'corpus-offset-instr']] = dt['corpus-runid'].str.strip().str.split('+', expand=True) 29 dt["corpus-relscale"] = pd.to_numeric(dt["corpus-relscale"]) 27 30 28 31 def loadParseTimingData( infileLocal, xClasNames=[], xClasDtypes={}, xFactNames=[], xFactDtypes={} ): … … 32 35 timings = pd.read_csv( 33 36 infile, 34 names=['test', 'corpus'] + xClasNames + [ 'concatsPerReset', 'corpusItemCount ', 'corpusMeanLenChars', 'concatDoneActualCount', 'execTimeActualSec'] + xFactNames,37 names=['test', 'corpus'] + xClasNames + [ 'concatsPerReset', 'corpusItemCountAct', 'corpusMeanLenCharsAct', 'concatDoneActualCount', 'execTimeActualSec'] + xFactNames, 35 38 dtype={**xClasDtypes, **xFactDtypes, **{ 36 39 'test': str, 37 40 'corpus': str, 38 41 'concatsPerReset': 'Int64', # allows missing; https://stackoverflow.com/a/70626154 39 'corpusItemCount ':np.int64,40 'corpusMeanLenChars ':np.float64,42 'corpusItemCountAct': np.int64, 43 'corpusMeanLenCharsAct': np.float64, 41 44 'concatDoneActualCount': np.int64, 42 45 'execTimeActualSec': np.float64, -
doc/theses/mike_brooks_MMath/plots/string-allocn-attrib.py
rc8bdbaf re0350e0 14 14 import os 15 15 import sys 16 from pathlib import Path 16 17 17 18 sys.path.insert(0, os.path.dirname(__file__)) … … 19 20 20 21 sizes_i_want = [50, 200] # [20, 50, 100, 200] 22 defaultExpansionCfa = 0.2 21 23 22 # assume CFA threshold only run at default value 24 metaFilename = os.path.dirname(os.path.abspath(__file__)) + '/string-allocn-attrib-meta.dat' 25 catOrder = Path(metaFilename).read_text() 26 catOrder = str.split(catOrder) 23 27 24 28 cfatimings = loadParseTimingData('result-allocate-speed-cfa.csv', 25 29 xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'}, 26 30 xFactNames=['topIters'], xFactDtypes={'topIters':np.int64}) 31 cfatimings = cfatimings.groupby('expansion').get_group(defaultExpansionCfa) 27 32 28 33 cfaattribs = loadParseAttribData('result-allocate-attrib-cfa.ssv') 34 cfaattribs = cfaattribs.groupby('expansion').get_group(defaultExpansionCfa) 35 36 cfasizings = loadParseSizingData('result-allocate-space-cfa.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'}) 37 cfasizings = cfasizings.groupby('expansion').get_group(defaultExpansionCfa) 29 38 30 39 stltimings = loadParseTimingData('result-allocate-speed-stl.csv', … … 34 43 stlattribs = loadParseAttribData('result-allocate-attrib-stl.ssv') 35 44 45 stlsizings = loadParseSizingData('result-allocate-space-stl.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'}) 46 36 47 timings = pd.concat([cfatimings, stltimings]) 37 48 attribs = pd.concat([cfaattribs, stlattribs]) 49 sizings = pd.concat([cfasizings, stlsizings]) 50 51 # print("before join", timings.shape[0], attribs.shape[0]) 52 # print(timings.to_csv(header=True, index=True, sep='\t', na_rep="0")) 53 # print(attribs.to_csv(header=True, index=True, sep='\t', na_rep="0")) 54 # print(sizings.to_csv(header=True, index=True, sep='\t', na_rep="0")) 38 55 39 56 combined = pd.merge( 40 left=timings[['sut-platform', 'corpus -meanlen','expansion', 'op-duration-ns']],41 right=attribs[['sut-platform', 'corpus -meanlen','expansion', 'category', 'fraction']],42 on=['sut-platform', 'corpus -meanlen','expansion']57 left=timings[['sut-platform', 'corpus', 'corpus-meanlen-tgt','expansion', 'op-duration-ns']], 58 right=attribs[['sut-platform', 'corpus', 'expansion', 'category', 'fraction']], 59 on=['sut-platform', 'corpus','expansion'] 43 60 ) 44 61 62 combined = pd.merge( 63 left=combined, 64 right=sizings[['sut-platform', 'corpus','expansion','hw_cur_req_mem(B)']], 65 on=['sut-platform', 'corpus','expansion'] 66 ) 67 68 # print("after join", combined.shape[0]) 69 # print(combined.to_csv(header=True, index=True, sep='\t', na_rep="0")) 70 45 71 combined['cat-duration-ns'] = combined['op-duration-ns'] * combined['fraction'] 46 combined.drop(columns=['expansion', 'op-duration-ns', 'fraction' ], inplace=True)72 combined.drop(columns=['expansion', 'op-duration-ns', 'fraction', 'corpus'], inplace=True) 47 73 48 pvt = combined.pivot( columns='category', values='cat-duration-ns', index=['corpus-meanlen', 'sut-platform'] ) 74 # print("before summarize", combined.shape[0]) 75 # print(combined.to_csv(header=True, index=True, sep='\t', na_rep="0")) 49 76 50 desired_dcol_order = ["ctor-dtor", "gc", "malloc-free", "text-import", "harness-leaf", "other"] 51 pvt = pvt[desired_dcol_order] 77 summary = combined.pivot_table( 78 values=['hw_cur_req_mem(B)','cat-duration-ns'], 79 index=['corpus-meanlen-tgt', 'sut-platform', 'category'], 80 aggfunc={'hw_cur_req_mem(B)':'mean','cat-duration-ns':['mean', 'min', 'max']} ) 81 summary = summary.reset_index() 82 summary.columns = summary.columns.to_flat_index() 83 summary.columns = [ 84 '-'.join(filter(None, col)).replace(' ', '-') # replaces space with dash if needed 85 for col in summary.columns.to_flat_index() 86 ] 52 87 53 filtered = pvt.loc[pvt.index.get_level_values('corpus-meanlen').isin(sizes_i_want)] 88 # reorder columns with memory as first value (after sut-platform, which is last key) 89 # cols = summary.columns.tolist() 90 # cols.remove("hw_cur_req_mem(B)-mean") 91 # insert_after = cols.index("sut-platform") + 1 92 # cols.insert(insert_after, "hw_cur_req_mem(B)-mean") 93 # summary = summary[cols] 54 94 55 print(filtered.to_csv(header=True, index=True, sep='\t', na_rep="0")) 95 summary = summary[[ 96 'corpus-meanlen-tgt', 97 'sut-platform', 98 'hw_cur_req_mem(B)-mean', 99 'category', 100 'cat-duration-ns-mean', 101 'cat-duration-ns-max', 102 'cat-duration-ns-min']] 56 103 104 # print("after summarize", summary.shape[0]) 105 # print(summary.to_csv(header=True, index=True, sep='\t', na_rep="0")) 106 107 108 109 # Ensure 'category' follows the specified order 110 summary['category'] = pd.Categorical(summary['category'], categories=catOrder, ordered=True) 111 112 # Sort the DataFrame to prepare for cumulative sum 113 summary_sorted = summary.sort_values(by=['corpus-meanlen-tgt', 'sut-platform', 'category']) 114 115 # Group by the keys and compute exclusive running total 116 summary_sorted['grp-prior-duration-ns'] = ( 117 summary_sorted 118 .groupby(['corpus-meanlen-tgt', 'sut-platform'])['cat-duration-ns-mean'] 119 .transform(lambda s: s.cumsum().shift(fill_value=0)) 120 ) 121 122 summary_sorted = summary_sorted.reset_index(drop=True) 123 124 125 # print("after accumulation", summary_sorted.shape[0]) 126 # print(summary_sorted.to_csv(header=True, index=True, sep='\t', na_rep="0")) 127 128 129 filtered = summary_sorted[summary_sorted['corpus-meanlen-tgt'].isin(sizes_i_want)] 130 131 # print("after filter", filtered.shape[0]) 132 133 print(filtered.to_csv(header=True, index=False, sep='\t', na_rep="0")) -
doc/theses/mike_brooks_MMath/plots/string-allocn.gp
rc8bdbaf re0350e0 5 5 INDIR="build" 6 6 OUTDIR="build" 7 SRCDIR="plots" 7 8 8 9 SCALE=1024 … … 11 12 set macros 12 13 set output OUTDIR."/plot-string-allocn.pdf" 13 set multiplot layout 1, 3 ; 14 set key outside top center horizontal 14 set multiplot layout 1, 2 ; 15 15 set grid 16 16 17 # common to only first two graphs18 set logscale x 219 #set mxtics 3 # 3 steps within each doubling (e.g. 3 steps of of 32 between 32 and 128 => tick on 32s in there)20 set xlabel "Heap Used (B)"21 set logscale y 1022 17 23 18 # … … 25 20 # 26 21 22 #set errorbars dashtype '.' 23 24 set logscale x 2 25 set xlabel "Heap Used (B)" 26 set logscale y 10 27 set key outside top center 28 27 29 set ylabel "Duration (ns)" offset 2,0 28 set yrange[ 35:125]29 set ytics add (40, 50, 60, 70, 80, 90, 110, 120 )30 set yrange[40:150] 31 set ytics add (40, 50, 60, 70, 80, 90, 110, 120, 130, 140, 150) 30 32 31 set xrange[32: 4096]33 set xrange[32:8192] 32 34 set xtics rotate by -90 33 35 set xtics ("" 32, "64 k" 64, "" 128, "256 k" 256, "" 512, "1 M" 1024, "" 2048, "4 M" 4096) … … 35 37 # First each curve, then each default-expansion point 36 38 plot INDIR."/plot-string-allocn.dat" \ 37 i 0 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "blue" pt 2 ps 1 lw 1, \ 38 '' i 1 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "red" pt 3 ps 1 lw 1, \ 39 '' i 2 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "brown" pt 8 ps 1 lw 1, \ 40 '' i 3 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "black" pt 10 ps 1 lw 1, \ 41 '' i 4 using ($3/SCALE):2 title columnheader(1) with linespoints lt rgb "magenta" pt 12 ps 1 lw 1, \ 42 '' i 0 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "blue" pt 66 ps 2, \ 43 '' i 1 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "red" pt 66 ps 2, \ 44 '' i 2 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "brown" pt 66 ps 2, \ 45 '' i 3 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "black" pt 66 ps 2, \ 46 '' i 4 using ( ($4 == 1) ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "magenta" pt 66 ps 2 39 i 0 using ($5/SCALE):2 notitle with lines lt rgb "blue" dt '.' lw 2, \ 40 '' i 1 using ($5/SCALE):2 notitle with lines lt rgb "red" dt '.' lw 2, \ 41 '' i 2 using ($5/SCALE):2 notitle with lines lt rgb "brown" dt '.' lw 2, \ 42 '' i 3 using ($5/SCALE):2 title "tuning contour" with lines lt rgb "black" dt '.' lw 2, \ 43 '' i 4 using ($5/SCALE):2 notitle with lines lt rgb "magenta" dt '.' lw 2, \ 44 '' i 0 using ($5/SCALE):2:3:4 notitle with yerrorbars lt rgb "blue" pt 7 ps 0.25 lw 1, \ 45 '' i 1 using ($5/SCALE):2:3:4 notitle with yerrorbars lt rgb "red" pt 7 ps 0.25 lw 1, \ 46 '' i 2 using ($5/SCALE):2:3:4 notitle with yerrorbars lt rgb "brown" pt 7 ps 0.25 lw 1, \ 47 '' i 3 using ($5/SCALE):2:3:4 notitle with yerrorbars lt rgb "black" pt 7 ps 0.25 lw 1, \ 48 '' i 4 using ($5/SCALE):2:3:4 notitle with yerrorbars lt rgb "magenta" pt 7 ps 0.25 lw 1, \ 49 '' i 0 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "blue" pt 66 ps 2, \ 50 '' i 1 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "red" pt 66 ps 2, \ 51 '' i 2 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "brown" pt 66 ps 2, \ 52 '' i 3 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 title "default tuning" \ 53 with points lt rgb "black" pt 66 ps 2, \ 54 '' i 4 using ( ($8 == 1) ? ($5/SCALE) : 1/0 ):2 notitle with points lt rgb "magenta" pt 66 ps 2, \ 55 '' i 0 using ($5/SCALE):2:("{/Times=15 len-\n20") every ::1::1 with labels left offset 0.75,0.25 textcolor rgb "blue" notitle, \ 56 '' i 1 using ($5/SCALE):2:("{/Times=15 len-\n50") every ::5::5 with labels right offset -0.6 ,1.5 textcolor rgb "red" notitle, \ 57 '' i 2 using ($5/SCALE):2:("{/Times=15 len-\n100") every ::4::4 with labels right offset -0.75,0.5 textcolor rgb "brown" notitle, \ 58 '' i 3 using ($5/SCALE):2:("{/Times=15 len-\n200") every ::4::4 with labels right offset -0.75,1.25 textcolor rgb "black" notitle, \ 59 '' i 4 using ($5/SCALE):2:("{/Times=15 len-\n500") every ::4::4 with labels right offset -0.75,0.25 textcolor rgb "magenta" notitle, \ 60 '' i 5 using ($5/SCALE) :2 notitle with lines lt rgb "#BF007F7F" lw 8, \ 61 '' i 6 using ($5/SCALE) :2 notitle with lines lt rgb "#BF007F7F" lw 8, \ 62 '' i 7 using ($5/SCALE) :2 notitle with lines lt rgb "#BF007F7F" lw 8, \ 63 '' i 8 using ($5/SCALE) :2 title "tradeoff" with lines lt rgb "#BF007F7F" lw 8, \ 64 '' i 9 using ($5/SCALE) :2 notitle with lines lt rgb "#BF007F7F" lw 8, \ 65 '' i 5 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 , \ 66 '' i 6 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 , \ 67 '' i 7 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 , \ 68 '' i 8 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 , \ 69 '' i 9 using ( (strcol(8) eq "stl") ? ($5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 70 47 71 48 72 unset ylabel 73 unset xlabel 49 74 50 75 unset xtics … … 53 78 unset xrange 54 79 55 56 #57 # STL comparison58 #59 60 61 set yrange[40:85]62 set ytics add (40, 45, 50, 55, 60, 65, 70, 75, 80, 85)63 set mytics 90 # 90 steps within each decade (e.g. 90 steps of of 1 between 10 and 100 => tick on 1s in there)64 65 set xrange[64:4096]66 set xtics rotate by -9067 set xtics ("64 k" 64, "128 k" 128, "256 k" 256, "512 k" 512, "1 M" 1024, "2 M" 2048, "4 M" 4096)68 69 # skullduggeries:70 # hardcoding chunk index and assuming data in the chunk (by hardcoding only the stl series title)71 # series order is meaningless but important: achieves z-order readability and legend order acceptability72 73 plot INDIR."/plot-string-allocn.dat" \74 i 8 using ($3/SCALE) :2 title "tradeoff" with lines lt rgb "#77000000" dt (2,2) lw 8, \75 '' i 1 using ($3/SCALE) :2 title columnheader(1) with linespoints lt rgb "red" pt 3 ps 1 lw 1, \76 '' i 6 using ( (strcol(4) eq "cfa") ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "red" pt 66 ps 2, \77 '' i 6 using ($3/SCALE) :2 notitle with lines lt rgb "#77000000" dt (2,2) lw 8, \78 '' i 6 using ( (strcol(4) eq "stl") ? ($3/SCALE) : 1/0 ):2 title "stl, len=50" with points lt rgb "red" pt 5 ps 1, \79 '' i 3 using ($3/SCALE) :2 title columnheader(1) with linespoints lt rgb "black" pt 10 ps 1 lw 1, \80 '' i 8 using ( (strcol(4) eq "stl") ? ($3/SCALE) : 1/0 ):2 title "stl, len=200" with points lt rgb "black" pt 5 ps 1, \81 '' i 8 using ( (strcol(4) eq "cfa") ? ($3/SCALE) : 1/0 ):2 notitle with points lt rgb "black" pt 66 ps 282 83 84 unset mytics85 unset ytics86 unset yrange87 unset xrange88 89 90 91 # common to first two graphs92 80 unset logscale 93 81 unset xlabel … … 98 86 # 99 87 100 set style data histogram 88 set key outside top center vertical maxrows 3 89 90 set logscale x 2 91 #set mxtics 3 # 3 steps within each doubling (e.g. 3 steps of of 32 between 32 and 128 => tick on 32s in there) 92 93 set yrange[0:105] 101 94 set ytics auto 102 set style histogram clustered gap 1 rowstacked103 set style fill solid border -1104 set boxwidth 0.8105 set xtics rotate by -45106 95 107 plot for [col=3:8] \ 108 INDIR.'/plot-string-allocn-attrib.dat' using col:xticlabels(stringcolumn(2).", len=".stringcolumn(1)) index 0 title columnheader(col) 96 set xrange[2.0e4:3e7] 97 # set xtics rotate by -90 98 # set xtics ("" 32, "64 k" 64, "" 128, "256 k" 256, "" 512, "1 M" 1024, "" 2048, "4 M" 4096) 99 100 set style fill solid 1.0 101 102 BAR_RELWD = 0.5 103 BAR_XSHIFT = (1+BAR_RELWD)**(-0.55) 104 LEN_X_SEP = 1.7 105 106 # get segment draw order (front to back) from metadata file 107 meta = system('cat '.SRCDIR.'/string-allocn-attrib-meta.dat') 108 STATS_words = words(meta) 109 array STATS_word[STATS_words] 110 do for [i=1:STATS_words] { 111 STATS_word[i] = word(meta, i) 112 } 113 114 115 116 plot \ 117 for [i=STATS_words:1:-1] \ 118 INDIR.'/plot-string-allocn-attrib.dat' \ 119 using (stringcolumn("category") eq STATS_word[i] ? (BAR_XSHIFT*$1**LEN_X_SEP*$3/SCALE) : 1/0): \ 120 (stringcolumn("category") eq STATS_word[i] ? ($5 + $8) : 1/0): \ 121 (stringcolumn("category") eq STATS_word[i] ? (BAR_RELWD*(BAR_XSHIFT*$1**LEN_X_SEP*$3/SCALE)) : 1/0) \ 122 with boxes ls i title STATS_word[i], \ 123 INDIR."/plot-string-allocn.dat" \ 124 i 1 using (50 **LEN_X_SEP*$5/SCALE):2 notitle with lines lt rgb "red" dt '.' lw 2, \ 125 '' i 3 using (200**LEN_X_SEP*$5/SCALE):2 notitle with lines lt rgb "black" dt '.' lw 2, \ 126 '' i 1 using ( ($8 == 1) ? (50 **LEN_X_SEP*$5/SCALE) : 1/0 ):2 notitle with points lt rgb "red" pt 66 ps 2, \ 127 '' i 3 using ( ($8 == 1) ? (200**LEN_X_SEP*$5/SCALE) : 1/0 ):2 notitle with points lt rgb "black" pt 66 ps 2, \ 128 '' i 1 using ( ($8 == 1) ? (50 **LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "red" pt 7 ps 0.25 lw 1, \ 129 '' i 3 using ( ($8 == 1) ? (200**LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "black" pt 7 ps 0.25 lw 1, \ 130 '' i 1 using (50 **LEN_X_SEP*$5/SCALE):2:("{/Times=15 len-\n50") every ::5::5 with labels right offset -0.6 ,1.5 textcolor rgb "red" notitle, \ 131 '' i 3 using (200**LEN_X_SEP*$5/SCALE):2:("{/Times=15 len-\n200") every ::4::4 with labels right offset -0.75,1.25 textcolor rgb "black" notitle, \ 132 '' i 6 using (50 **LEN_X_SEP*$5/SCALE) :2 notitle with lines lt rgb "#BF007F7F" lw 8, \ 133 '' i 8 using (200**LEN_X_SEP*$5/SCALE) :2 notitle with lines lt rgb "#BF007F7F" lw 8, \ 134 '' i 6 using ( (strcol(8) eq "stl") ? (50 **LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 , \ 135 '' i 8 using ( (strcol(8) eq "stl") ? (200**LEN_X_SEP*$5/SCALE) : 1/0 ):2:3:4 notitle with yerrorbars lt rgb "#00007F7F" pt 6 ps 0.5 lw 2 136 137 138 # i 6 using ($5/SCALE) :2:(BAR_RELWD*($5/SCALE)) notitle with boxes lt rgb "grey" , \ 139 # '' i 8 using ($5/SCALE) :2:(BAR_RELWD*($5/SCALE)) notitle with boxes lt rgb "grey" , \ 140 # '' i 6 using ($5/SCALE) :($2-40):(BAR_RELWD*($5/SCALE)) notitle with boxes lt rgb "blue", \ 141 # '' i 8 using ($5/SCALE) :($2-40):(BAR_RELWD*($5/SCALE)) notitle with boxes lt rgb "blue", \ -
doc/theses/mike_brooks_MMath/plots/string-allocn.py
rc8bdbaf re0350e0 31 31 100:[-1.0, 0.1, 0.2, 0.5, 0.9], 32 32 200:[-1.0, 0.1, 0.2, 0.5, 0.9], 33 500:[-1.0, 0. 4, 0.9, 0.98]}33 500:[-1.0, 0.2, 0.4, 0.9, 0.98]} 34 34 35 35 defaultExpansions = [-1, 0.2] … … 56 56 ) 57 57 58 combined['is-default'] = np.isin(combined['expansion'], defaultExpansions).astype(int) 58 combined = combined.pivot_table( values=['op-duration-ns','hw_cur_req_mem(B)'], index=['corpus-meanlen-tgt', 'sut-platform', 'expansion'], aggfunc=['mean', 'min', 'max'] ) 59 combined = combined.reset_index() 60 combined.columns = combined.columns.to_flat_index() 61 62 # text = combined.to_csv(header=True, index=True, sep='\t') 63 # print(text) 64 65 66 combined['is-default'] = np.isin(combined[('expansion','')], defaultExpansions).astype(int) 67 68 59 69 60 70 # print ('!!') … … 66 76 # First, for the CFA curves 67 77 sut = "cfa" 68 sutGroup = combined.groupby( 'sut-platform').get_group(sut)78 sutGroup = combined.groupby(('sut-platform','')).get_group(sut) 69 79 70 groupedSize = sutGroup.groupby( 'corpus-meanlen')80 groupedSize = sutGroup.groupby(('corpus-meanlen-tgt','')) 71 81 72 82 for sz, szgroup in groupedSize: 73 83 74 84 if sz in favSizes.keys(): 75 szgroup_sorted = szgroup.sort_values(by= 'expansion')85 szgroup_sorted = szgroup.sort_values(by=('expansion','')) 76 86 77 87 print('"{sut}, len={len}"'.format(sut=sut, len=sz)) 78 88 # print(szgroup_sorted) ## 79 89 # print(szgroup_sorted['expansion'], 'isin', favSizes[sz]) ## 80 favoured = szgroup_sorted.loc[szgroup_sorted[ 'expansion'].isin(favSizes[sz])]90 favoured = szgroup_sorted.loc[szgroup_sorted[('expansion','')].isin(favSizes[sz])] 81 91 # print('!') ## 82 92 # print(favoured) ## 83 text = favoured[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'is-default']].to_csv(header=False, index=False, sep='\t') 93 text = favoured[[('expansion',''), 94 ('mean','op-duration-ns'), 95 ('min','op-duration-ns'), 96 ('max','op-duration-ns'), 97 ('mean', 'hw_cur_req_mem(B)'), 98 ('min', 'hw_cur_req_mem(B)'), 99 ('max', 'hw_cur_req_mem(B)'), 100 'is-default']].to_csv(header=False, index=False, sep='\t') 84 101 print(text) 85 102 print() … … 89 106 atDefaults = combined.groupby('is-default').get_group(1) 90 107 91 for sz, szgroup in atDefaults.groupby( 'corpus-meanlen'):108 for sz, szgroup in atDefaults.groupby(('corpus-meanlen-tgt','')): 92 109 93 110 if sz in favSizes.keys(): 94 111 print(sz) 95 text = szgroup[['expansion', 'op-duration-ns', 'hw_cur_req_mem(B)', 'sut-platform']].to_csv(header=False, index=False, sep='\t') 112 text = szgroup[[('expansion',''), 113 ('mean','op-duration-ns'), 114 ('min','op-duration-ns'), 115 ('max','op-duration-ns'), 116 ('mean', 'hw_cur_req_mem(B)'), 117 ('min', 'hw_cur_req_mem(B)'), 118 ('max', 'hw_cur_req_mem(B)'), 119 ('sut-platform','')]].to_csv(header=False, index=False, sep='\t') 96 120 print(text) 97 121 print() -
doc/theses/mike_brooks_MMath/plots/string-pbv-fixcorp.py
rc8bdbaf re0350e0 26 26 27 27 28 # Filter operation=pbv, corpus=1 -*-128 # Filter operation=pbv, corpus=100-*-*+*+l1 29 29 30 30 timings = timings.groupby('operation').get_group('pbv') 31 timings = timings.groupby('corpus-nstrs ').get_group(1)32 timings = timings.groupby('corpus- runid').get_group(1)31 timings = timings.groupby('corpus-nstrs-tgt').get_group(100) 32 timings = timings.groupby('corpus-offset-instr').get_group('l1') 33 33 34 34 … … 41 41 if sut in prettyFieldNames: 42 42 43 sgroup_sorted = sgroup.sort_values(by='corpus -meanlen')43 sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct') 44 44 45 45 print('"{header}"'.format(header=prettyFieldNames[sut])) 46 text = sgroup_sorted[['corpus -meanlen', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t')46 text = sgroup_sorted[['corpusMeanLenCharsAct', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t') 47 47 print(text) 48 48 print() -
doc/theses/mike_brooks_MMath/plots/string-pbv-varcorp.py
rc8bdbaf re0350e0 26 26 27 27 28 # Filter operation=pbv, corpus=100-*- 128 # Filter operation=pbv, corpus=100-*-*+*+t0 29 29 30 30 timings = timings.groupby('operation').get_group('pbv') 31 timings = timings.groupby('corpus-nstrs ').get_group(100)32 timings = timings.groupby('corpus- runid').get_group(1)31 timings = timings.groupby('corpus-nstrs-tgt').get_group(100) 32 timings = timings.groupby('corpus-offset-instr').get_group('t0') 33 33 34 34 … … 41 41 if sut in prettyFieldNames: 42 42 43 sgroup_sorted = sgroup.sort_values(by='corpus -meanlen')43 sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct') 44 44 45 45 print('"{header}"'.format(header=prettyFieldNames[sut])) 46 text = sgroup_sorted[['corpus -meanlen', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t')46 text = sgroup_sorted[['corpusMeanLenCharsAct', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t') 47 47 print(text) 48 48 print() -
doc/theses/mike_brooks_MMath/plots/string-pbv.gp
rc8bdbaf re0350e0 25 25 set linetype 4 dashtype 2 26 26 plot INDIR."/plot-string-pbv-varcorp.dat" \ 27 i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 3 ps 1 lw1, \28 '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 6 ps 1 lw127 i 0 using 1:2 title columnheader(1) with points lt rgb "red" pt 3 ps 1, \ 28 '' i 1 using 1:2 title columnheader(1) with points lt rgb "blue" pt 6 ps 1 29 29 30 30 set xlabel "String length passed, fixed" 31 31 set ylabel 32 32 plot INDIR."/plot-string-pbv-fixcorp.dat" \ 33 i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 3 ps 1 lw1, \34 '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 6 ps 1 lw133 i 0 using 1:2 title columnheader(1) with points lt rgb "red" pt 3 ps 1, \ 34 '' i 1 using 1:2 title columnheader(1) with points lt rgb "blue" pt 6 ps 1 35 35 36 36 unset multiplot -
doc/theses/mike_brooks_MMath/plots/string-peq-cppemu.gp
rc8bdbaf re0350e0 20 20 set linetype 4 dashtype 2 21 21 plot INDIR."/plot-string-peq-cppemu.dat" \ 22 i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 2 ps 1 lw1, \23 '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 3 ps 1 lw1, \24 '' i 2 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 6 ps 1 lw1, \25 '' i 3 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 8 ps 1 lw122 i 0 using 1:2 title columnheader(1) with points lt rgb "red" pt 2 ps 1, \ 23 '' i 1 using 1:2 title columnheader(1) with points lt rgb "red" pt 1 ps 1, \ 24 '' i 2 using 1:2 title columnheader(1) with points lt rgb "blue" pt 6 ps 1, \ 25 '' i 3 using 1:2 title columnheader(1) with points lt rgb "blue" pt 8 ps 1 -
doc/theses/mike_brooks_MMath/plots/string-peq-cppemu.py
rc8bdbaf re0350e0 27 27 timings = loadParseTimingData('result-append-pbv.csv') 28 28 29 # Filter operation=peq, corpus=100-*- 129 # Filter operation=peq, corpus=100-*-*+*+t0 30 30 31 31 timings = timings.groupby('operation').get_group('peq') 32 timings = timings.groupby('corpus-nstrs').get_group(100) 33 timings = timings.groupby('corpus-runid').get_group(1) 32 timings = timings.groupby('corpus-nstrs-tgt').get_group(100) 33 timings = timings.groupby('corpus-offset-instr').get_group('t0') 34 35 34 36 35 37 # Emit in groups … … 41 43 if sut in prettyFieldNames: 42 44 43 sgroup_sorted = sgroup.sort_values(by='corpus -meanlen')45 sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct') 44 46 45 47 print('"{header}"'.format(header=prettyFieldNames[sut])) 46 text = sgroup_sorted[['corpus -meanlen', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t')48 text = sgroup_sorted[['corpusMeanLenCharsAct', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t') 47 49 print(text) 48 50 print() -
doc/theses/mike_brooks_MMath/plots/string-peq-sharing.gp
rc8bdbaf re0350e0 20 20 set linetype 4 dashtype 2 21 21 plot INDIR."/plot-string-peq-sharing.dat" \ 22 i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 2 ps 1 lw1, \23 '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 3 ps 1 lw1, \24 '' i 2 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 6 ps 1 lw1, \25 '' i 3 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 8 ps 1 lw122 i 0 using 1:2 title columnheader(1) with points lt rgb "red" pt 2 ps 1, \ 23 '' i 1 using 1:2 title columnheader(1) with points lt rgb "red" pt 1 ps 1, \ 24 '' i 2 using 1:2 title columnheader(1) with points lt rgb "blue" pt 6 ps 1, \ 25 '' i 3 using 1:2 title columnheader(1) with points lt rgb "blue" pt 8 ps 1 -
doc/theses/mike_brooks_MMath/plots/string-peq-sharing.py
rc8bdbaf re0350e0 28 28 29 29 30 # Filter operation=peq, corpus=100-*- 130 # Filter operation=peq, corpus=100-*-*+*+t0 31 31 32 32 timings = timings.groupby('operation').get_group('peq') 33 timings = timings.groupby('corpus-nstrs ').get_group(100)34 timings = timings.groupby('corpus- runid').get_group(1)33 timings = timings.groupby('corpus-nstrs-tgt').get_group(100) 34 timings = timings.groupby('corpus-offset-instr').get_group('t0') 35 35 36 36 … … 43 43 if sut in prettyFieldNames: 44 44 45 sgroup_sorted = sgroup.sort_values(by='corpus -meanlen')45 sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct') 46 46 47 47 print('"{header}"'.format(header=prettyFieldNames[sut])) 48 text = sgroup_sorted[['corpus -meanlen', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t')48 text = sgroup_sorted[['corpusMeanLenCharsAct', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t') 49 49 print(text) 50 50 print() -
doc/theses/mike_brooks_MMath/plots/string-pta-sharing.gp
rc8bdbaf re0350e0 19 19 #show colornames 20 20 plot INDIR."/plot-string-pta-sharing.dat" \ 21 i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red" pt 2 ps 1 lw1, \22 '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "dark-green" pt 4 ps 1 lw1, \23 '' i 2 using 1:2 title columnheader(1) with linespoints lt rgb "blue" pt 6 ps 1 lw1, \24 '' i 3 using 1:2 title columnheader(1) with linespoints lt rgb "dark-green" pt 12 ps 1 lw121 i 0 using 1:2 title columnheader(1) with points lt rgb "red" pt 2 ps 1, \ 22 '' i 1 using 1:2 title columnheader(1) with points lt rgb "dark-green" pt 4 ps 1, \ 23 '' i 2 using 1:2 title columnheader(1) with points lt rgb "blue" pt 6 ps 1, \ 24 '' i 3 using 1:2 title columnheader(1) with points lt rgb "dark-green" pt 12 ps 1 -
doc/theses/mike_brooks_MMath/plots/string-pta-sharing.py
rc8bdbaf re0350e0 32 32 33 33 34 # Filter corpus=100-*-1 34 # Filter corpus=100-*-1, corpus=100-*-*+*+t0 35 35 36 timings = timings.groupby('corpus-nstrs ').get_group(100)37 timings = timings.groupby('corpus- runid').get_group(1)36 timings = timings.groupby('corpus-nstrs-tgt').get_group(100) 37 timings = timings.groupby('corpus-offset-instr').get_group('t0') 38 38 39 39 # Emit in groups … … 50 50 if sut in opPretty: 51 51 52 sgroup_sorted = tgtOpTimings.sort_values(by='corpus -meanlen')52 sgroup_sorted = tgtOpTimings.sort_values(by='corpusMeanLenCharsAct') 53 53 54 54 print('"{header}"'.format(header=opPretty[sut])) 55 text = sgroup_sorted[['corpus -meanlen', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t')55 text = sgroup_sorted[['corpusMeanLenCharsAct', 'op-duration-ns']].to_csv(header=False, index=False, sep='\t') 56 56 print(text) 57 57 print()
Note:
See TracChangeset
for help on using the changeset viewer.