Ignore:
Timestamp:
Sep 22, 2025, 2:52:19 PM (6 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master, stuck-waitfor-destruct
Children:
3d02803
Parents:
bb5b866
Message:

LL perf: small fixes

Fix off-by-one bug in runtime-no-shuf solution. Add safety check that interleaving is off. Re-run.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/benchmarks/list/driver.c

    rbb5b866 r78bc398  
    6060#else
    6161    enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckDonePeriod = 2, DefaultExperimentDurOpCount = 20, DefaultSeed = 5 };
    62     const double DefaultInterleaveFrac = 0.5;
     62    const double DefaultInterleaveFrac = 0.0;
    6363    static const char * tp_filter
    6464    // = "";
     
    266266            return 1;
    267267        }
    268         // Fill with the ordinals (iota)
    269         for (size_t i = 0; i < NumNodes; i++) {
    270             insertOrdShuf[i] = i;
    271         }
    272268        // Dummy "Seed" of -1 means skip the shuffle: measure overhead of shuffling indirection
    273         if (Seed != -1) {
     269        if (Seed == -1) {
     270            // Fill with the ordinals, shifted left (iota+1)
     271            // The specific single-cyle permutation that visits each item in order
     272            for (size_t i = 0; i < NumNodes; i++) {
     273                insertOrdShuf[i] = (i+1) % NumNodes;
     274            }
     275        } else {
     276            // Fill with the ordinals (iota)
     277            for (size_t i = 0; i < NumNodes; i++) {
     278                insertOrdShuf[i] = i;
     279            }
    274280            // Shuffle per https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Sattolo's_algorithm
    275281            // Don't want to draw from all permutations, only single-cycle permutations
     
    371377        // no action required on no-interleave
    372378        if ( InterleaveFrac > 0.0 ) {
     379            assert(false && "interleaving was abandoned; always run with InterleaveFrac=0.0");
    373380
    374381            // assert( ( NumNodes >= 2 * N_INTERLEAVE_ACTION)
Note: See TracChangeset for help on using the changeset viewer.