Ignore:
Timestamp:
Jul 27, 2025, 3:25:11 PM (8 weeks ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
5ba1356
Parents:
b9d1242
Message:

Continue disabling harness features, achieving best-case times that match Peter's, on the three tests with new CSVs here.

The fully-disabled harness probably still fools the optimizer because it uses the Buhr-Dice "pass function" trick in place of the disabled observation and iterators array. That these times are now often beating Peter's requires further investigation.

Make STL run with (cpp-sltref) and without (cpp-stlrefAlloGlib) llheap.
Include peter-*.csv from runs on Swift. (Thesis still builds with original numbers from labpc.)
Add data post-processing for sorting and aggregation, leveraging thesis's plots' framework.

Add makefile-saved setups for matching Peter.
Add ability to disable "observation" (use of volatiles) and iterators array (support for remelem).
Add integrated clean-build-run targets for varying the "disable" switches.
Strengthen disable-interleaving mode to avoid the extra loops on remove.

Still to entertain some of this stripping being unnecessary for achieving near Peter-match.
Still to compare costs of the relevant stripped features, and recommend harness variation(s) to for use in thesis.

Location:
doc/theses/mike_brooks_MMath/benchmarks
Files:
6 added
3 edited

Legend:

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

    rb9d1242 r2b0e754  
    11# For correctness, see test-correctness.sh.
    2 # For performance:
    3 # pushd ~/cfax
    4 # . ~/setcfa build-fast
    5 # popd
    6 # make perfprogs CFA=$cfa -j8 MODE=performance
    7 # make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=common5
    8 # cp results-latest.csv results-baseline.csv
    9 # make results-latest.csv OP_MOVEMENTS=stack OP_POLARITIES=insfirst OP_ACCESSORS=allhead RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=thorough
    10 # cp results-latest.csv results-sizing.csv
    11 # make results-latest.csv OP_MOVEMENTS=queue OP_POLARITIES=inslast OP_ACCESSORS=remelem RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=thorough
    12 # cp results-latest.csv results-sizing-b.csv
    13 # make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=moderate FX_SOLUTIONS='lq-tailq lq-list cfa-cfa upp-upp'
    14 # cp results-latest.csv results-intrsv-cube.csv
    15 
    16 CFA = cfa
    17 CC = gcc-11
    18 CXX = g++-11
    19 UXX =  ~/u++/u++-7.0.0/bin/u++
    20 
    21 MODE=performance
    22 EXTRA_COMP_FLAGS=
    23 RUN_NUM_REPS=3
    24 RUN_DATA_SIZE_MODE=none
     2# For performance, example:
     3#       pushd ~/cfax
     4#       . ~/setcfa build-fast
     5#       popd
     6#       make perfprogs CFA=$cfa -j8 MODE=performance
     7#       make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=common5
     8#       cp results-latest.csv results-baseline.csv
     9# For performance, see also: `results-smoketest.csv`, `make thesis`, and more such applied targets at the end
     10
     11CFA ?= cfa
     12CC ?= gcc-11
     13CXX ?= g++-11
     14UXX ?=  ~/u++/u++-7.0.0/bin/u++
     15
     16MODE?=performance
     17EXTRA_COMP_FLAGS?=
     18RUN_NUM_REPS?=3
     19RUN_DATA_SIZE_MODE?=none
    2520RUN_DURATION_SEC?=5
    26 RUN_TASKSET_CPULIST=6
     21RUN_TASKSET_CPULIST?=6
     22
     23LLHEAP_LIB=../llheap/libllheap.so
    2724
    2825ifeq "$(MODE)" "performance"
     
    6865endef
    6966
    70 OP_MOVEMENTS=stack queue
    71 OP_POLARITIES=insfirst inslast
    72 OP_ACCESSORS=allhead inselem remelem
    73 RUN_INTERLEAVE_PCTS=0
    74 
    75 
    76 FX_SOLUTIONS=lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref
     67OP_MOVEMENTS?=stack queue
     68OP_POLARITIES?=insfirst inslast
     69OP_ACCESSORS?=allhead inselem remelem
     70RUN_INTERLEAVE_PCTS?=0
     71
     72
     73FX_SOLUTIONS?=lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref
    7774
    7875OPS=$(call cross3,-,$(OP_MOVEMENTS),$(OP_POLARITIES),$(OP_ACCESSORS))
     
    9895CORES=$(call filterFds,$(CORES_FULL))                    # lq-tailq--stack-inslast-allhead
    9996
     97.SECONDEXPANSION: # allow $$ expansion for dynamic dependencies
     98
    10099
    101100PERFPROGS=$(call cross,--,perfexp,$(CORES))
     
    116115perfexp--upp-% driver--upp-%.o : COMPILER=$(UXX) $(PERFFLAGS_UXX)
    117116perfexp--%     driver--%.o     : COMPILER=NO-COMPILER-FOR-$(FX_COARSE)
     117
     118USE_LLHEAP=no
     119perfexp--cpp-% driver--cpp-%.o : USE_LLHEAP=yes
     120perfexp--cpp-%AllocGlib driver--cpp-%AllocGlib.o : USE_LLHEAP=no
     121
     122LLHEAP_LIB_COND=$(if $(filter $(USE_LLHEAP),yes),$(LLHEAP_LIB))
     123LLHEAP_PRELOAD_COND=$(if $(filter $(USE_LLHEAP),yes),LD_PRELOAD=$(LLHEAP_LIB))
     124
     125$(dir $(LLHEAP_LIB)) :
     126        $(error Manual action required: clone llheap into $@)
     127
     128$(LLHEAP_LIB) : $$(dir $$@)
     129        $(MAKE) -C $< $(notdir $@)
    118130
    119131# Without this %.d rule, ordinary make runs have noise about the recipe for driver--%.o being ill-formed when called on a *.d.
     
    126138        @touch $@
    127139
    128 perfexp--% : driver--%.o observation.o
     140ifeq "$(MAKE_DISABLE_OBSERVATION)" "yes"
     141OBSERVATION_COMP_FLAG= -DDISABLE_OBSERVATION
     142OBSERVATION_OBJ_COND=
     143else
     144OBSERVATION_COMP_FLAG=
     145OBSERVATION_OBJ_COND= observation.o
     146endif
     147
     148perfexp--% : $$(LLHEAP_LIB_COND) driver--%.o $(OBSERVATION_OBJ_COND)
    129149        $(COMPILER) $(EXTRA_COMP_FLAGS) $^ -o $@
    130150
    131151driver--%.o : driver.c
    132         $(COMPILER) $(EXTRA_COMP_FLAGS) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
     152        $(COMPILER) $(EXTRA_COMP_FLAGS) $(OBSERVATION_COMP_FLAG) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
    133153
    134154
     
    136156echo_% :
    137157        @echo '$($(@:echo_%=%))'
    138 
    139 
    140 
    141 
    142 # ifeq "$(RUN_DATA_SIZE_MODE)" "common5"
    143 # RUN_DATA_SIZES=\
    144 #   7-1000000 \
    145 #   71-100000 \
    146 #   809-10000 \
    147 #   9051-1000 \
    148 #   72421-100
    149 # else ifeq "$(RUN_DATA_SIZE_MODE)" "thorough"
    150 # RUN_DATA_SIZES=\
    151 #   1-1000000 \
    152 #   2-1000000 \
    153 #   3-1000000 \
    154 #   5-1000000 \
    155 #   7-1000000 \
    156 #   11-100000 \
    157 #   13-100000 \
    158 #   19-100000 \
    159 #   29-100000 \
    160 #   37-100000 \
    161 #   53-100000 \
    162 #   71-100000 \
    163 #   101-10000 \
    164 #   149-10000 \
    165 #   211-10000 \
    166 #   283-10000 \
    167 #   401-10000 \
    168 #   569-10000 \
    169 #   809-10000 \
    170 #   1151-1000 \
    171 #   1601-1000 \
    172 #   2267-1000 \
    173 #   3203-1000 \
    174 #   4547-1000 \
    175 #   6473-1000 \
    176 #   9051-1000 \
    177 #   12809-100 \
    178 #   18119-100 \
    179 #   25601-100 \
    180 #   36209-100 \
    181 #   51203-100 \
    182 #   72421-100 \
    183 #   102407-10 \
    184 #   144817-10 \
    185 #   204803-10 \
    186 #   289637-10 \
    187 #   409609-10 \
    188 #   579263-10 \
    189 #   819229-10 \
    190 #   1158613-1 \
    191 #   1638431-1 \
    192 #   2317057-1 \
    193 #   3276803-1 \
    194 #   4634111-1 \
    195 #   6553621-1 \
    196 #   9268211-1
    197 # else ifeq "$(RUN_DATA_SIZE_MODE)" "bignquick"
    198 # RUN_DATA_SIZES=\
    199 #   3-1000000 \
    200 #   29-100000 \
    201 #   283-10000 \
    202 #   3203-1000 \
    203 #   25601-100 \
    204 #   289637-10 \
    205 #   1000000-1 \
    206 #   3276803-1 \
    207 #   10000000-1
    208 # else ifeq "$(RUN_DATA_SIZE_MODE)" "bignthorough"
    209 # RUN_DATA_SIZES=\
    210 #   1-1000000 \
    211 #   3-1000000 \
    212 #   7-1000000 \
    213 #   13-100000 \
    214 #   29-100000 \
    215 #   53-100000 \
    216 #   101-10000 \
    217 #   211-10000 \
    218 #   401-10000 \
    219 #   809-10000 \
    220 #   1601-1000 \
    221 #   3203-1000 \
    222 #   6473-1000 \
    223 #   12809-100 \
    224 #   25601-100 \
    225 #   51203-100 \
    226 #   102407-10 \
    227 #   204803-10 \
    228 #   409609-10 \
    229 #   819229-10 \
    230 #   1638431-1 \
    231 #   3276803-1 \
    232 #   6553621-1 \
    233 #   12809000-1 \
    234 #   25601000-1 \
    235 #   51203000-1 \
    236 #   102407000-1 \
    237 #   204803000-1 \
    238 #   409609000-1
    239 # else ifeq "$(RUN_DATA_SIZE_MODE)" "moderate"
    240 # RUN_DATA_SIZES=\
    241 #   1-1000000 \
    242 #   3-1000000 \
    243 #   7-1000000 \
    244 #   13-100000 \
    245 #   29-100000 \
    246 #   53-100000 \
    247 #   101-10000 \
    248 #   211-10000 \
    249 #   401-10000 \
    250 #   1601-1000 \
    251 #   6473-1000 \
    252 #   25601-100
    253 # else ifeq "$(RUN_DATA_SIZE_MODE)" "sweetspot"
    254 # RUN_DATA_SIZES=\
    255 #   1-1000000 \
    256 #   2-1000000 \
    257 #   3-1000000 \
    258 #   5-1000000 \
    259 #   7-1000000 \
    260 #   11-100000 \
    261 #   13-100000 \
    262 #   19-100000 \
    263 #   29-100000 \
    264 #   37-100000 \
    265 #   53-100000 \
    266 #   71-100000 \
    267 #   101-10000 \
    268 #   149-10000
    269 # else ifeq "$(RUN_DATA_SIZE_MODE)" "manual"
    270 # ifeq "$(RUN_DATA_SIZES)" ""
    271 # $(error RUN_DATA_SIZE_MODE is manual but RUN_DATA_SIZES not given)
    272 # endif
    273 # else ifeq "$(RUN_DATA_SIZE_MODE)" "none"
    274 # # Assume user manages RUN_ARGS; empty RUN_ARGS just means run with compiled-in defaults
    275 # RUN_DATA_SIZES=none
    276 # else
    277 # $(error Bad RUN_DATA_SIZE_MODE ($(RUN_DATA_SIZE_MODE)); should be common5, thorough or manual)
    278 # endif
    279158
    280159
     
    407286  101-10000 \
    408287  149-10000 \
     288, $(if $(filter $(RUN_DATA_SIZE_MODE),peter), \
     289  4-1000000 \
     290  8-1000000 \
     291  16-100000 \
     292  32-100000 \
     293  64-100000 \
     294  128-10000 \
     295  256-10000 \
     296  512-10000 \
     297  1024-1000 \
     298  2048-1000 \
     299  4096-1000 \
     300  8192-1000 \
     301  16384-100 \
     302  32768-100 \
     303  65536-100 \
     304  131072-10 \
     305  262144-10 \
     306  524288-10 \
     307  1048576-1 \
     308  2097152-1 \
     309  4194304-1 \
     310  8388608-1 \
     311  16777216-1 \
    409312, $(if $(filter $(RUN_DATA_SIZE_MODE),none), \
    410313, $(error Bad RUN_DATA_SIZE_MODE ($(RUN_DATA_SIZE_MODE)); see list of accepted values in Makefile's RUN_DATA_SIZES defimition) \
    411 )))))))
     314))))))))
    412315
    413316RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)})              # 1 2 3
     
    433336%.1csv : RUN_ARGS=$(if $(filter none,$(SIZING)),,$(RUN_DURATION_SEC) $(CHECKDONE) $(NUMNODES) -1 $(SEED) $(RUN_INTERLEAVE_FRAC))  # use REP_ID as seed
    434337%.1csv : REP_TIME=$(shell date '+%F %H:%M:%S')
     338%.1csv : FX=$(call proj,--,$(CORE),1)
     339%.1csv : IS_CPP=$(filter cpp-%,$(FX))
     340%.1csv : IS_NOT_EXPLICIT_GLIB=$(filter-out %AllocGlib,$(FX))
     341%.1csv : USE_LLHEAP=$(if $(and $(IS_CPP),$(IS_NOT_EXPLICIT_GLIB)),yes,no)
    435342%.1csv : perfprogs FORCE
    436         taskset --cpu-list $(RUN_TASKSET_CPULIST) ./perfexp--$(CORE) $(RUN_ARGS) | xargs -n 1 printf '%s,%s,%s,%s\n' "$(REP_TIME)" "$(REP_ID)" "$(RUN_ARGS)" | tee -a $(RESULT)
    437 
    438 
    439 BATCHTIME=$(shell date '+%F--%H-%M-%S')
     343# @echo $(FX) $(IS_CPP) $(IS_NOT_EXPLICIT_GLIB) $(USE_LLHEAP) $(LLHEAP_PRELOAD_COND)
     344        taskset --cpu-list $(RUN_TASKSET_CPULIST) sh -c '$(LLHEAP_PRELOAD_COND) ./perfexp--$(CORE) $(RUN_ARGS)' | xargs -n 1 printf '%s,%s,%s,%s\n' "$(REP_TIME)" "$(REP_ID)" "$(RUN_ARGS)" | tee -a $(RESULT)
     345
     346# := for evaluate once and save
     347# =  for letting cmdline override
     348BATCHTIME:=$(shell date '+%F--%H-%M-%S')
    440349RESULT=results--$(BATCHTIME).csv
    441350
     
    473382-include *.d
    474383
    475 results-general.csv: FORCE
     384results-general.csv: FORCE cleanbuild
    476385        $(MAKE) results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=sweetspot OP_ACCESSORS=remelem RUN_INTERLEAVE_PCTS='0 50' FX_SOLUTIONS='lq-tailq lq-list cfa-cfa cfa-mandHead'
    477386        cat results-latest.csv >> $@
     
    487396        cat results-latest.csv >> $@
    488397
    489 results-zoomout-noshuf.csv: FORCE
    490         @echo Do we need to make for tiny user iters?  If so:
    491         @echo make clean
    492         @echo make perfprogs CFA=$$cfa EXTRA_COMP_FLAGS=-DTINY_USER_ITEMS -j8
     398results-zoomout-noshuf.csv: EXTRA_COMP_FLAGS+= -DTINY_USER_ITEMS
     399results-zoomout-noshuf.csv: FORCE cleanbuild
    493400        make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=bignthorough OPS=stack-insfirst-allhead FX_SOLUTIONS='lq-tailq cfa-cfa upp-upp cpp-stlref cfa-strip' SEED=-1
    494401        cp results-latest.csv $@
    495402
    496 results-zoomout-shuf.csv: FORCE
    497         @echo Do we need to make for tiny user iters?  If so:
    498         @echo make clean
    499         @echo make perfprogs CFA=$$cfa EXTRA_COMP_FLAGS=-DTINY_USER_ITEMS -j8
     403results-zoomout-shuf.csv: EXTRA_COMP_FLAGS+= -DTINY_USER_ITEMS
     404results-zoomout-shuf.csv: FORCE cleanbuild
    500405        make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=bignthorough OPS=stack-insfirst-allhead FX_SOLUTIONS='lq-tailq cfa-cfa upp-upp cpp-stlref cfa-strip'
    501406        cp results-latest.csv $@
    502407
    503 thesis: results-general.csv results-zoomout-noshuf.csv results-zoomout-shuf.csv
    504 
    505 # matches peter's "random"
     408thesis:
     409        $(MAKE) results-general.csv
     410        $(MAKE) results-zoomout-noshuf.csv
     411        $(MAKE) results-zoomout-shuf.csv
     412
    506413results-smoketest.csv: RUN_DATA_SIZE_MODE=bignquick
    507414results-smoketest.csv: RUN_NUM_REPS=1
     
    512419results-smoketest.csv: $(RESULT)
    513420        mv $< $@
     421
     422CPUS_AVAIL=8
     423
     424export RUN_DATA_SIZE_MODE
     425export RUN_NUM_REPS
     426export RUN_DURATION_SEC
     427export OP_MOVEMENTS
     428export OP_POLARITIES
     429export OP_ACCESSORS
     430export EXTRA_COMP_FLAGS
     431export FX_SOLUTIONS
     432export MAKE_DISABLE_OBSERVATION
     433
     434cleanbuild: FORCE clean
     435        $(MAKE) -j $(CPUS_AVAIL) perfprogs
     436
     437# equivalents to peter's tests
     438
     439peter-all:
     440        $(MAKE) results-peter-linear.csv
     441        $(MAKE) results-peter-random2.csv
     442        $(MAKE) results-peter-removeHere.csv
     443
     444# debatable FX_SOLUTIONS using cfa-cfa or cfa-mandhead
     445# cfa-cfa faster on allhead (so I thought from thesis analysis; doubting that now under minimal harness), slower on remelem
     446# cfa-mandhead IS what Peter's using
     447results-peter-%.csv: RUN_DATA_SIZE_MODE=peter
     448results-peter-%.csv: RUN_NUM_REPS=3
     449results-peter-%.csv: RUN_DURATION_SEC=3
     450results-peter-%.csv: OP_MOVEMENTS=stack
     451results-peter-%.csv: OP_POLARITIES=insfirst
     452results-peter-%.csv: OP_ACCESSORS=allhead
     453results-peter-%.csv: FX_SOLUTIONS=cfa-mandHead cpp-stlref cpp-stlrefAllocGlib
     454results-peter-%.csv: MAKE_DISABLE_OBSERVATION=yes
     455results-peter-%.csv: cleanbuild $(RESULT)
     456        mv $(RESULT) $@
     457
     458results-peter-linear.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_SHUFFLING_INDIRECTION -DDISABLE_ITERS_AR -DTINY_USER_ITEMS
     459
     460results-peter-random2.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_ITERS_AR -DTINY_USER_ITEMS
     461
     462results-peter-removeHere.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING  -DDISABLE_SHUFFLING_INDIRECTION -DTINY_USER_ITEMS
     463results-peter-removeHere.csv: OP_ACCESSORS=remelem
     464
     465peter-summary.txt: FORCE
     466        rm -f $@
     467        printf '#size\tmean\tstd\tmin\tmax\tntrials\tignore\tignore\n' >> $@
     468        echo >> $@
     469        for f in results-peter*.csv; do echo -------------- $$f ---------------- >> $@; python3 qplot.py $$f >> $@; done
  • doc/theses/mike_brooks_MMath/benchmarks/list/driver.c

    rb9d1242 r2b0e754  
    44#include <string.h>
    55
     6#ifdef DISABLE_OBSERVATION
     7#include "proglang.h"
     8#define bobs_init(...)
     9#else
    610#include "observation.h"
     11#endif
    712
    813#ifdef TINY_USER_ITEMS
     
    2025{
    2126    BFX_INTRUSION(B_UserItem)
     27//    BFX_LISTED_ELEM_T(B_UserItem) selfListed;
    2228    UDATA_T userdata[ UDATA_LEN ];
    2329}
     
    5157static BFX_LIST_HEAD_T(B_UserItem) lst;
    5258
     59#ifdef DISABLE_OBSERVATION
     60MAYBE_EXTERN_C (
     61    void bobs_seek(unsigned int i) {}
     62    void bobs_moveNext() {}
     63    void bobs_movePrev() {}
     64    int bobs_hasCurrent() { return 0; }
     65    void * bobs_getCurrentLoc() { return NULL; }
     66    int bobs_getCurrentVal() { return 0; }
     67    // enum bobs_op_movement_t bobs_op_movement = OP_MOVEMENT;
     68    // enum bobs_op_polarity_t bobs_op_polarity = OP_POLARITY;
     69)
     70
     71#else
     72
    5373MAYBE_EXTERN_C (
    5474
     
    87107    enum bobs_op_polarity_t bobs_op_polarity = OP_POLARITY;
    88108)
    89 
     109#endif
     110
     111
     112#ifndef DISABLE_OBSERVATION
    90113
    91114// Remove progress end (number) is based (upon) remove-number
     
    101124)
    102125
     126#endif // ndef DISABLE_OBSERVATION
     127
    103128unsigned int uDefaultPreemption() {
    104129        return 0;
    105130}
    106131
     132#ifdef DISABLE_ITERS_AR
     133// Saves on memory accesses, makes element-oriented removals and observation impossible (instead, they crash)
     134static inline BFX_LISTED_ELEM_T(B_UserItem) buhrdice_pass( BFX_LISTED_ELEM_T(B_UserItem) v ) {   // prevent eliding, cheaper than volatile
     135    __asm__ __volatile__ ( "" : "+r"(v) );
     136    return v ;
     137} // pass
     138#define ITERS_SAVE(i, insertElemExpr) buhrdice_pass(insertElemExpr)
     139#endif
     140
    107141int main(int argc, const char *argv[]) {
     142
     143  #ifdef DISABLE_OBSERVATION
     144    // define the outbound dependencies as locals, for compiling into nops
     145    size_t       bobs_ops_completed      = 0;
     146    unsigned int bobs_prog_inserting     = 0;
     147    unsigned int bobs_prog_removing      = 0;
     148    unsigned int bobs_prog_removing_end  = 0;
     149    unsigned int bobs_prog_rollover_flag = 0;
     150  #endif
    108151
    109152    const char * usage_args = "[ExperimentDurSec [CheckDonePeriod [NumNodes [ExperimentDurOpCount [Seed [InterleaveFrac]]]]]]";
     
    227270    memset(ui, 0, (size_t)NumNodes * (size_t)sizeof(B_UserItem));
    228271
     272  #ifndef DISABLE_ITERS_AR
    229273    listedItems = (BFX_LISTED_ELEM_T(B_UserItem)*)malloc( (size_t)NumNodes * (size_t)sizeof(BFX_LISTED_ELEM_T(B_UserItem)) );
    230274    if (!listedItems) {
     
    233277    }
    234278    memset(listedItems, 0, (size_t)NumNodes * (size_t)sizeof(BFX_LISTED_ELEM_T(B_UserItem)));
     279    #define ITERS_SAVE(i, insertElemExpr) listedItems[i] = (insertElemExpr)
     280  #endif
    235281
    236282    // Construct and fill with demo data
     
    285331        for ( int t = 0; t < CheckDonePeriod; t += 1 ) {
    286332            TRACE('a')              // insert special first
    287             listedItems[0] =
    288                 BOP_INIT(lst, listedItems, 0, ui[INSERTPOS(0)]);
     333            ITERS_SAVE( 0,
     334                BOP_INIT(lst, listedItems, 0, ui[INSERTPOS(0)]) );
    289335            TRACE('b')              // insert general
    290336            for ( int privateCurInsert = 1;
     
    293339                ) {
    294340                TRACE('-')
    295                 listedItems[privateCurInsert] =
    296                     BOP_INSERT( lst, listedItems, privateCurInsert, ui[INSERTPOS(privateCurInsert)] );
     341                ITERS_SAVE( privateCurInsert,
     342                    BOP_INSERT( lst, listedItems, privateCurInsert, ui[INSERTPOS(privateCurInsert)] ) );
    297343                TRACE('+')
    298344            }
     345          #ifdef DISABLE_INTERLEAVING
     346            // interleaving off, simple removes
     347            // (remove logic of 2b01f8eb0956)
     348            TRACE('c')
     349            for ( int privateCurRemove = 1;
     350                  (bobs_prog_removing = privateCurRemove, privateCurRemove < NumNodes);
     351                  privateCurRemove += 1
     352                ) {
     353                TRACE('-')
     354                BOP_REMOVE( lst, listedItems, privateCurRemove-1 );
     355                TRACE('+')
     356            }
     357          #else
     358            // interleaving on, complex removes
    299359            TRACE('c')              // remove general
    300360            int removeProgress[] = { 0, 0 };
     
    324384                }
    325385            }
     386          #endif // DISABLE_INTERLEAVING
    326387            TRACE('D')              // remove special last
    327388            BOP_TEARDOWN(lst, listedItems, NumNodes-1);
  • doc/theses/mike_brooks_MMath/benchmarks/list/qplot.py

    rb9d1242 r2b0e754  
    88
    99printSingleDetail(
    10     infileLocal = sys.argv[1],
    11     tgtMovement = 'stack',
    12     tgtPolarity = 'insfirst',
    13     tgtAccessor = 'allhead'
    14 
    15 
    16     # tgtMovement = 'all',
    17     # tgtPolarity = 'all',
    18     # tgtAccessor = 'remelem',
    19     # tgtInterleave = 0.5
    20     )
     10    infileLocal = sys.argv[1]
     11)
Note: See TracChangeset for help on using the changeset viewer.