Ignore:
Timestamp:
May 13, 2025, 1:17:37 PM (4 months ago)
Author:
Mike Brooks <mlbrooks@…>
Branches:
master
Children:
bd72f517
Parents:
ae0c1c3
Message:

Include benchmark changes for data production in string-plot data WIP. Missing from 2410424.

Location:
doc/theses/mike_brooks_MMath/benchmarks/string
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/benchmarks/string/Makefile

    rae0c1c3 r7d02d35  
     1# Usage
     2# $cfabuild/driver/cfa -nodebug -quiet -c -x c /dev/null && rm null.o || echo Need to fix \$cfabuild
     3# make CFABUILD=$cfabuild -j8                                                                                                                                                                                                           # compile
     4# make measurement  CFA_APILEVELS=ll OPERATIONS='pta peq pbv'                             CORPORI='corpus-100-*-1.txt corpus-1-*-1.txt' # append-pbv
     5# make measurement2 CFA_APILEVELS=ll OPERATIONS='pall' PLATFORMS=cfa CFA_SHARINGS=share   CORPORI='corpus-1-*-1.txt'                                            # allocate-speed-cfa
     6# make measurement2 CFA_APILEVELS=ll OPERATIONS='pall' PLATFORMS=stl CFA_EXPANSIONS=-1.0  CORPORI='corpus-1-*-1.txt'                                            # allocate-speed-stl
     7# make measurement3 CFA_APILEVELS=ll OPERATIONS='pall' PLATFORMS=cfa CFA_SHARINGS=share   CORPORI='corpus-1-*-1.txt'                                            # allocate-space-cfa
     8# make measurement3 CFA_APILEVELS=ll OPERATIONS='pall' PLATFORMS=stl CFA_EXPANSIONS=-1.0  CORPORI='corpus-1-*-1.txt'                                            # allocate-space-stl
     9# make measurement4 CFA_APILEVELS=ll OPERATIONS='pall' PLATFORMS=cfa CFA_EXPANSIONS=0.2   CFA_SHARINGS=share   CORPORI='corpus-1-*-1.txt'       # allocate-attrib-cfa
     10# make measurement4 CFA_APILEVELS=ll OPERATIONS='pall' PLATFORMS=stl CFA_EXPANSIONS=-1.0                       CORPORI='corpus-1-*-1.txt'       # allocate-attrib-stl
    111
    212CFABUILD = ~/cfa2/build-perf
     
    3747endef
    3848
    39 OPERATIONS=pta peq pbv pall pno
     49OPERATIONS=pta peq pbv pall #pno
    4050ALLOCS=reuse fresh
    4151CFA_APILEVELS=hl ll
    4252CFA_SHARINGS=share noshare
    43 PLATFORMS=cfa stl buhr94
     53PLATFORMS=cfa stl #buhr94
    4454
    4555ifneq ($(filter cfa,$(PLATFORMS)),)
     
    142152CORPORI = corpus-100-*-1.txt
    143153
     154RUN_TASKSET_CPULIST=6
     155
     156# General timing
     157# Output file gets concatenation of program outputs
    144158measurement: $(MEASURE)
    145159        tofile=measurement-`date '+%F--%H-%M-%S'`.csv ; \
     
    148162            for corpus in $(CORPORI) ; do \
    149163                        corpusbody=`cat $$corpus` ; \
    150                         printed=`./$$prog 100 10 $$corpusbody` ; \
    151                         echo $$prog,$$corpus,$$printed  >>  $$tofile ; \
    152                         echo $$prog,$$corpus,$$printed  ; \
    153                 done ; \
    154         done
    155 #                       printed=`./$$prog 10000 - 10 $$corpusbody` ; \
    156 
    157 CFA_EXPANSIONS=0.02 0.05 0.1 0.2 0.5 0.9
    158 
     164                        resulttext=`taskset --cpu-list $(RUN_TASKSET_CPULIST) ./$$prog 100 10 $$corpusbody` ; \
     165                        echo $$prog,$$corpus,$$resulttext  >>  $$tofile ; \
     166                        echo $$prog,$$corpus,$$resulttext  ; \
     167                done ; \
     168        done
     169
     170CFA_EXPANSIONS=0.02 0.05 0.1 0.2 0.4 0.5 0.9 0.98
     171
     172# Special-case timing with extra IV for CFA_EXPANSIONS
     173# Output file gets concatenation of program outputs (one line per run)
    159174measurement2: $(MEASURE)
    160175        tofile=measurement-`date '+%F--%H-%M-%S'`.csv ; \
     
    179194        done
    180195
     196# Space, with the IV for CFA_EXPANSIONS
     197# Runs Mubeen's malloc interceptor to get malloc-request state
     198# Output file gets concatenation of the interceptor's output (one line per run); program's output ignorred
     199# Expect and ignore crashes; they're during shutdown, after everything we care about is over
    181200measurement3: $(MEASURE)
     201        tofile=measurement-`date '+%F--%H-%M-%S'`.ssv ; \
    182202        for prog in $(MEASURE) ; do \
    183203            for corpus in $(CORPORI) ; do \
    184204                        for expansion in $(CFA_EXPANSIONS) ; do \
    185205                                corpusbody=`cat $$corpus` ; \
    186                                 LD_PRELOAD=~/plg2/mubeen-stat-shim/malloc/mallocWrappers.so ./$$prog 1000 1.006 $$expansion 1 $$corpusbody ; \
    187                                 mv preload_dump.txt preload_dump--qrun1--$$corpus--expansion-$$expansion.txt ; \
    188                         done ; \
    189                 done ; \
    190         done
     206                                LD_PRELOAD=~/plg2/mubeen-stat-shim/malloc/mallocWrappers.so ./$$prog 1000 1.006 $$expansion 10 $$corpusbody ; \
     207                                printed=`tail -n 1 preload_dump.txt` ; \
     208                                echo $$prog $$corpus $$expansion $$printed  >>  $$tofile ; \
     209                                echo $$prog $$corpus $$expansion $$printed  ; \
     210                                rm preload_dump.txt ; \
     211                        done ; \
     212                done ; \
     213        done
     214
     215# Time attribution, with the IV for CFA_EXPANSIONS
     216# Runs the SUT under perf, then crunches the perf result
     217# Output file gets concatenation of perf summaries (several lines per run); program's output ignorred
     218# Expect and ignore output "addr2line: DWARF error: section .debug_info is larger than its filesize!"
     219measurement4: $(MEASURE)
     220        RUNID=`date '+%F--%H-%M-%S'` ; \
     221        tofile=measurement-$$RUNID.ssv ; \
     222        echo $$tofile ; \
     223        for prog in $(MEASURE) ; do \
     224            for corpus in $(CORPORI) ; do \
     225                        for expansion in $(CFA_EXPANSIONS) ; do \
     226                                SLUG=measurement--$$prog--$$corpus--$$expansion--$$RUNID ; \
     227                                corpusbody=`cat $$corpus` ; \
     228                                perf record --call-graph dwarf -m16M ./$$prog 1000 1.006 $$expansion 10 $$corpusbody ; \
     229                                mv perf.data $$SLUG.data ; \
     230                                perf script -i $$SLUG.data > $$SLUG.perf ; \
     231                                ~/flamegraph/FlameGraph/stackcollapse-perf.pl $$SLUG.perf > $$SLUG.folded ; \
     232                                ~/flamegraph/FlameGraph/flamegraph.pl $$SLUG.folded > $$SLUG.svg ; \
     233                                python3 process-allocn-attrib.py $$SLUG.folded | xargs -L1 echo $$prog $$corpus $$expansion >> $$tofile ; \
     234                        done ; \
     235                done ; \
     236        done
  • doc/theses/mike_brooks_MMath/benchmarks/string/make-flamegraph.sh

    rae0c1c3 r7d02d35  
    1010# $3 is coprus id  : x-100-20-1  (goes with corpusx-100-20-1.txt)
    1111
    12 SLUG=perf--$1--${2//[ .]/-}--$3
     12SLUG=perf--$1--${2//[ .]/-}--$3--`date '+%F--%H-%M-%S'`
     13benchdir=$(dirname "$0")
     14echo benchdir = $benchdir
    1315
    14 perf record --call-graph dwarf -m16M ~/plg2/cfa2/cfa-cc/tests/zombies/string-perf/perfexp-$1 $2 `cat ~/plg2/cfa2/cfa-cc/tests/zombies/string-perf/corpus$3.txt`
     16perf record --call-graph dwarf -m16M $benchdir/perfexp-$1 $2 `cat $benchdir/corpus$3.txt`
    1517
    1618mv perf.data $SLUG.data
     
    1820../flamegraph/FlameGraph/stackcollapse-perf.pl $SLUG.perf > $SLUG.folded
    1921../flamegraph/FlameGraph/flamegraph.pl $SLUG.folded > $SLUG.svg
    20 cp $SLUG.svg ~/plg2/flames
     22#cp $SLUG.svg ~/plg2/flames
  • doc/theses/mike_brooks_MMath/benchmarks/string/prog-allocn.cfa

    rae0c1c3 r7d02d35  
    4242#endif
    4343
    44 
    4544#if defined IMPL_CFA_HL
    4645  #include <string.hfa>
     46  #include <fstream.hfa>
    4747  extern void TUNING_set_string_heap_liveness_threshold(double);  // in string_res.hfa
    4848#elif defined IMPL_CFA_LL
    4949  #include <string_res.hfa>
     50  #include <fstream.hfa>
    5051#endif
    5152
  • doc/theses/mike_brooks_MMath/benchmarks/string/prog-passbyval.cfa

    rae0c1c3 r7d02d35  
    4545#if defined IMPL_CFA_HL
    4646  #include <string.hfa>
     47  #include <fstream.hfa>
    4748#elif defined IMPL_CFA_LL
    4849  #include <string_res.hfa>
     50  #include <fstream.hfa>
    4951#endif
    5052
  • doc/theses/mike_brooks_MMath/benchmarks/string/prog.cfa

    rae0c1c3 r7d02d35  
    4545#if defined IMPL_CFA_HL
    4646  #include <string.hfa>
     47  #include <fstream.hfa>
    4748#elif defined IMPL_CFA_LL
    4849  #include <string_res.hfa>
     50  #include <fstream.hfa>
    4951#endif
    5052
Note: See TracChangeset for help on using the changeset viewer.