Ignore:
Timestamp:
Jun 4, 2025, 1:43:34 PM (4 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
f858ca5
Parents:
c8bdbaf
Message:

Recent rework of string benchmarks

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  
    1717
    1818    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)
    2020    dt[['corpus-slug',
    21         'corpus-nstrs',
    22         'corpus-meanlen',
     21        'corpus-nstrs-tgt',
     22        'corpus-meanlen-tgt',
    2323        '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"])
    2730
    2831def loadParseTimingData( infileLocal, xClasNames=[], xClasDtypes={}, xFactNames=[], xFactDtypes={} ):
     
    3235    timings = pd.read_csv(
    3336        infile,
    34         names=['test', 'corpus'] + xClasNames + [ 'concatsPerReset', 'corpusItemCount', 'corpusMeanLenChars', 'concatDoneActualCount', 'execTimeActualSec'] + xFactNames,
     37        names=['test', 'corpus'] + xClasNames + [ 'concatsPerReset', 'corpusItemCountAct', 'corpusMeanLenCharsAct', 'concatDoneActualCount', 'execTimeActualSec'] + xFactNames,
    3538        dtype={**xClasDtypes, **xFactDtypes, **{
    3639            'test':                  str,
    3740            'corpus':                str,
    3841            '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,
    4144            'concatDoneActualCount': np.int64,
    4245            'execTimeActualSec':     np.float64,
  • doc/theses/mike_brooks_MMath/plots/string-allocn-attrib.py

    rc8bdbaf re0350e0  
    1414import os
    1515import sys
     16from pathlib import Path
    1617
    1718sys.path.insert(0, os.path.dirname(__file__))
     
    1920
    2021sizes_i_want = [50, 200] # [20, 50, 100, 200]
     22defaultExpansionCfa = 0.2
    2123
    22 # assume CFA threshold only run at default value
     24metaFilename = os.path.dirname(os.path.abspath(__file__)) + '/string-allocn-attrib-meta.dat'
     25catOrder = Path(metaFilename).read_text()
     26catOrder = str.split(catOrder)
    2327
    2428cfatimings = loadParseTimingData('result-allocate-speed-cfa.csv',
    2529                xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'},
    2630                xFactNames=['topIters'], xFactDtypes={'topIters':np.int64})
     31cfatimings = cfatimings.groupby('expansion').get_group(defaultExpansionCfa)
    2732
    2833cfaattribs = loadParseAttribData('result-allocate-attrib-cfa.ssv')
     34cfaattribs = cfaattribs.groupby('expansion').get_group(defaultExpansionCfa)
     35
     36cfasizings = loadParseSizingData('result-allocate-space-cfa.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'})
     37cfasizings = cfasizings.groupby('expansion').get_group(defaultExpansionCfa)
    2938
    3039stltimings = loadParseTimingData('result-allocate-speed-stl.csv',
     
    3443stlattribs = loadParseAttribData('result-allocate-attrib-stl.ssv')
    3544
     45stlsizings = loadParseSizingData('result-allocate-space-stl.ssv', xClasNames=['expansion'], xClasDtypes={'expansion':'Float64'})
     46
    3647timings = pd.concat([cfatimings, stltimings])
    3748attribs = pd.concat([cfaattribs, stlattribs])
     49sizings = 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"))
    3855
    3956combined = 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']
    4360)
    4461
     62combined = 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
    4571combined['cat-duration-ns'] = combined['op-duration-ns'] * combined['fraction']
    46 combined.drop(columns=['expansion', 'op-duration-ns', 'fraction'], inplace=True)
     72combined.drop(columns=['expansion', 'op-duration-ns', 'fraction', 'corpus'], inplace=True)
    4773
    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"))
    4976
    50 desired_dcol_order = ["ctor-dtor", "gc", "malloc-free", "text-import", "harness-leaf", "other"]
    51 pvt = pvt[desired_dcol_order]
     77summary = 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']} )
     81summary = summary.reset_index()
     82summary.columns = summary.columns.to_flat_index()
     83summary.columns = [
     84    '-'.join(filter(None, col)).replace(' ', '-')  # replaces space with dash if needed
     85    for col in summary.columns.to_flat_index()
     86]
    5287
    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]
    5494
    55 print(filtered.to_csv(header=True, index=True, sep='\t', na_rep="0"))
     95summary = 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']]
    56103
     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
     110summary['category'] = pd.Categorical(summary['category'], categories=catOrder, ordered=True)
     111
     112# Sort the DataFrame to prepare for cumulative sum
     113summary_sorted = summary.sort_values(by=['corpus-meanlen-tgt', 'sut-platform',  'category'])
     114
     115# Group by the keys and compute exclusive running total
     116summary_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
     122summary_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
     129filtered = summary_sorted[summary_sorted['corpus-meanlen-tgt'].isin(sizes_i_want)]
     130
     131# print("after filter", filtered.shape[0])
     132
     133print(filtered.to_csv(header=True, index=False, sep='\t', na_rep="0"))
  • doc/theses/mike_brooks_MMath/plots/string-allocn.gp

    rc8bdbaf re0350e0  
    55INDIR="build"
    66OUTDIR="build"
     7SRCDIR="plots"
    78
    89SCALE=1024
     
    1112set macros
    1213set output OUTDIR."/plot-string-allocn.pdf"
    13 set multiplot layout 1, 3 ;
    14 set key outside top center horizontal
     14set multiplot layout 1, 2 ;
    1515set grid
    1616
    17 # common to only first two graphs
    18 set logscale x 2
    19 #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 10
    2217
    2318#
     
    2520#
    2621
     22#set errorbars dashtype '.'
     23
     24set logscale x 2
     25set xlabel "Heap Used (B)"
     26set logscale y 10
     27set key outside top center
     28
    2729set ylabel "Duration (ns)" offset 2,0
    28 set yrange[35:125]
    29 set ytics add (40, 50, 60, 70, 80, 90, 110, 120)
     30set yrange[40:150]
     31set ytics add (40, 50, 60, 70, 80, 90, 110, 120, 130, 140, 150)
    3032
    31 set xrange[32:4096]
     33set xrange[32:8192]
    3234set xtics rotate by -90
    3335set xtics ("" 32, "64 k" 64, "" 128, "256 k" 256, "" 512, "1 M" 1024, "" 2048, "4 M" 4096)
     
    3537# First each curve, then each default-expansion point
    3638plot 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
    4771
    4872unset ylabel
     73unset xlabel
    4974
    5075unset xtics
     
    5378unset xrange
    5479
    55 
    56 #
    57 # STL comparison
    58 #
    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 -90
    67 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 acceptability
    72 
    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 2
    82 
    83 
    84 unset mytics
    85 unset ytics
    86 unset yrange
    87 unset xrange
    88 
    89 
    90 
    91 # common to first two graphs
    9280unset logscale
    9381unset xlabel
     
    9886#
    9987
    100 set style data histogram
     88set key outside top center vertical maxrows 3
     89
     90set 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
     93set yrange[0:105]
    10194set ytics auto
    102 set style histogram clustered gap 1 rowstacked
    103 set style fill solid border -1
    104 set boxwidth 0.8
    105 set xtics rotate by -45
    10695
    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)
     96set 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
     100set style fill solid 1.0
     101
     102BAR_RELWD = 0.5
     103BAR_XSHIFT = (1+BAR_RELWD)**(-0.55)
     104LEN_X_SEP = 1.7
     105
     106# get segment draw order (front to back) from metadata file
     107meta = system('cat '.SRCDIR.'/string-allocn-attrib-meta.dat')
     108STATS_words = words(meta)
     109array STATS_word[STATS_words]
     110do for [i=1:STATS_words] {
     111    STATS_word[i] = word(meta, i)
     112}
     113
     114
     115
     116plot \
     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  
    3131            100:[-1.0, 0.1, 0.2, 0.5, 0.9],
    3232            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]}
    3434
    3535defaultExpansions = [-1, 0.2]
     
    5656)
    5757
    58 combined['is-default'] = np.isin(combined['expansion'], defaultExpansions).astype(int)
     58combined = combined.pivot_table( values=['op-duration-ns','hw_cur_req_mem(B)'], index=['corpus-meanlen-tgt', 'sut-platform', 'expansion'], aggfunc=['mean', 'min', 'max'] )
     59combined = combined.reset_index()
     60combined.columns = combined.columns.to_flat_index()
     61
     62# text = combined.to_csv(header=True, index=True, sep='\t')
     63# print(text)
     64
     65
     66combined['is-default'] = np.isin(combined[('expansion','')], defaultExpansions).astype(int)
     67
     68
    5969
    6070# print ('!!')
     
    6676# First, for the CFA curves
    6777sut = "cfa"
    68 sutGroup = combined.groupby('sut-platform').get_group(sut)
     78sutGroup = combined.groupby(('sut-platform','')).get_group(sut)
    6979
    70 groupedSize = sutGroup.groupby('corpus-meanlen')
     80groupedSize = sutGroup.groupby(('corpus-meanlen-tgt',''))
    7181
    7282for sz, szgroup in groupedSize:
    7383
    7484    if sz in favSizes.keys():
    75             szgroup_sorted = szgroup.sort_values(by='expansion')
     85            szgroup_sorted = szgroup.sort_values(by=('expansion',''))
    7686
    7787            print('"{sut}, len={len}"'.format(sut=sut, len=sz))
    7888            # print(szgroup_sorted)  ##
    7989            # 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])]
    8191            # print('!') ##
    8292            # 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')
    84101            print(text)
    85102            print()
     
    89106atDefaults = combined.groupby('is-default').get_group(1)
    90107
    91 for sz, szgroup in atDefaults.groupby('corpus-meanlen'):
     108for sz, szgroup in atDefaults.groupby(('corpus-meanlen-tgt','')):
    92109
    93110    if sz in favSizes.keys():
    94111            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')
    96120            print(text)
    97121            print()
  • doc/theses/mike_brooks_MMath/plots/string-pbv-fixcorp.py

    rc8bdbaf re0350e0  
    2626
    2727
    28 # Filter operation=pbv, corpus=1-*-1
     28# Filter operation=pbv, corpus=100-*-*+*+l1
    2929
    3030timings = timings.groupby('operation').get_group('pbv')
    31 timings = timings.groupby('corpus-nstrs').get_group(1)
    32 timings = timings.groupby('corpus-runid').get_group(1)
     31timings = timings.groupby('corpus-nstrs-tgt').get_group(100)
     32timings = timings.groupby('corpus-offset-instr').get_group('l1')
    3333
    3434
     
    4141    if sut in prettyFieldNames:
    4242
    43         sgroup_sorted = sgroup.sort_values(by='corpus-meanlen')
     43        sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct')
    4444
    4545        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')
    4747        print(text)
    4848        print()
  • doc/theses/mike_brooks_MMath/plots/string-pbv-varcorp.py

    rc8bdbaf re0350e0  
    2626
    2727
    28 # Filter operation=pbv, corpus=100-*-1
     28# Filter operation=pbv, corpus=100-*-*+*+t0
    2929
    3030timings = timings.groupby('operation').get_group('pbv')
    31 timings = timings.groupby('corpus-nstrs').get_group(100)
    32 timings = timings.groupby('corpus-runid').get_group(1)
     31timings = timings.groupby('corpus-nstrs-tgt').get_group(100)
     32timings = timings.groupby('corpus-offset-instr').get_group('t0')
    3333
    3434
     
    4141    if sut in prettyFieldNames:
    4242
    43         sgroup_sorted = sgroup.sort_values(by='corpus-meanlen')
     43        sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct')
    4444
    4545        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')
    4747        print(text)
    4848        print()
  • doc/theses/mike_brooks_MMath/plots/string-pbv.gp

    rc8bdbaf re0350e0  
    2525set linetype 4 dashtype 2
    2626plot INDIR."/plot-string-pbv-varcorp.dat" \
    27            i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  3  ps 1 lw 1, \
    28         '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "blue"   pt  6  ps 1 lw 1
     27           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
    2929
    3030set xlabel "String length passed, fixed"
    3131set ylabel
    3232plot INDIR."/plot-string-pbv-fixcorp.dat"  \
    33            i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  3  ps 1 lw 1, \
    34         '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "blue"   pt  6  ps 1 lw 1
     33           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
    3535
    3636unset multiplot
  • doc/theses/mike_brooks_MMath/plots/string-peq-cppemu.gp

    rc8bdbaf re0350e0  
    2020set linetype 4 dashtype 2
    2121plot INDIR."/plot-string-peq-cppemu.dat" \
    22            i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  2  ps 1 lw 1, \
    23         '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  3  ps 1 lw 1, \
    24         '' i 2 using 1:2 title columnheader(1) with linespoints lt rgb "blue"   pt  6  ps 1 lw 1, \
    25         '' i 3  using 1:2 title columnheader(1) with linespoints lt rgb "blue"  pt  8  ps 1 lw 1
     22           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  
    2727timings = loadParseTimingData('result-append-pbv.csv')
    2828
    29 # Filter operation=peq, corpus=100-*-1
     29# Filter operation=peq, corpus=100-*-*+*+t0
    3030
    3131timings = timings.groupby('operation').get_group('peq')
    32 timings = timings.groupby('corpus-nstrs').get_group(100)
    33 timings = timings.groupby('corpus-runid').get_group(1)
     32timings = timings.groupby('corpus-nstrs-tgt').get_group(100)
     33timings = timings.groupby('corpus-offset-instr').get_group('t0')
     34
     35
    3436
    3537# Emit in groups
     
    4143    if sut in prettyFieldNames:
    4244
    43         sgroup_sorted = sgroup.sort_values(by='corpus-meanlen')
     45        sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct')
    4446
    4547        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')
    4749        print(text)
    4850        print()
  • doc/theses/mike_brooks_MMath/plots/string-peq-sharing.gp

    rc8bdbaf re0350e0  
    2020set linetype 4 dashtype 2
    2121plot INDIR."/plot-string-peq-sharing.dat" \
    22            i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  2  ps 1 lw 1, \
    23         '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  3  ps 1 lw 1, \
    24         '' i 2 using 1:2 title columnheader(1) with linespoints lt rgb "blue"   pt  6  ps 1 lw 1, \
    25         '' i 3  using 1:2 title columnheader(1) with linespoints lt rgb "blue"  pt  8  ps 1 lw 1
     22           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  
    2828
    2929
    30 # Filter operation=peq, corpus=100-*-1
     30# Filter operation=peq, corpus=100-*-*+*+t0
    3131
    3232timings = timings.groupby('operation').get_group('peq')
    33 timings = timings.groupby('corpus-nstrs').get_group(100)
    34 timings = timings.groupby('corpus-runid').get_group(1)
     33timings = timings.groupby('corpus-nstrs-tgt').get_group(100)
     34timings = timings.groupby('corpus-offset-instr').get_group('t0')
    3535
    3636
     
    4343    if sut in prettyFieldNames:
    4444
    45         sgroup_sorted = sgroup.sort_values(by='corpus-meanlen')
     45        sgroup_sorted = sgroup.sort_values(by='corpusMeanLenCharsAct')
    4646
    4747        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')
    4949        print(text)
    5050        print()
  • doc/theses/mike_brooks_MMath/plots/string-pta-sharing.gp

    rc8bdbaf re0350e0  
    1919#show colornames
    2020plot INDIR."/plot-string-pta-sharing.dat" \
    21            i 0 using 1:2 title columnheader(1) with linespoints lt rgb "red"    pt  2  ps 1 lw 1, \
    22         '' i 1 using 1:2 title columnheader(1) with linespoints lt rgb "dark-green" pt  4  ps 1 lw 1, \
    23         '' i 2 using 1:2 title columnheader(1) with linespoints lt rgb "blue"   pt  6  ps 1 lw 1, \
    24         '' i 3  using 1:2 title columnheader(1) with linespoints lt rgb "dark-green" pt  12  ps 1 lw 1
     21           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  
    3232
    3333
    34 # Filter corpus=100-*-1
     34# Filter corpus=100-*-1, corpus=100-*-*+*+t0
    3535
    36 timings = timings.groupby('corpus-nstrs').get_group(100)
    37 timings = timings.groupby('corpus-runid').get_group(1)
     36timings = timings.groupby('corpus-nstrs-tgt').get_group(100)
     37timings = timings.groupby('corpus-offset-instr').get_group('t0')
    3838
    3939# Emit in groups
     
    5050            if sut in opPretty:
    5151
    52                 sgroup_sorted = tgtOpTimings.sort_values(by='corpus-meanlen')
     52                sgroup_sorted = tgtOpTimings.sort_values(by='corpusMeanLenCharsAct')
    5353
    5454                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')
    5656                print(text)
    5757                print()
Note: See TracChangeset for help on using the changeset viewer.