Changes in / [bb7422a:e02e13f]


Ignore:
Location:
doc/theses/mike_brooks_MMath/benchmarks/list
Files:
3 edited

Legend:

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

    rbb7422a re02e13f  
    1212UXX =  ~/u++/u++-7.0.0/bin/u++
    1313
    14 MODE = performance
     14MODE=performance
     15EXTRA_COMP_FLAGS=
     16RUN_NUM_REPS=3
    1517RUNARGS=
    1618
     
    101103perfexp--%     driver--%.o     : COMPILER=NO-COMPILER-FOR-$(FX_COARSE)
    102104
     105# Without this %.d rule, ordinary make runs have noise about the recipe for driver--%.o being ill-formed when called on a *.d.
     106# https://stackoverflow.com/questions/3714041/why-does-this-makefile-execute-a-target-on-make-clean
     107# Whatever you -include gets called as a target first.
     108# One such example is driver--upp-upp--stack-insfirst-allhead.d
     109# Without this %.d rule, `make make driver--upp-upp--stack-insfirst-allhead.d` leads to the rule for driver--%.o firing.
     110# Though my dumb human eyes don't see the pattern as matching.
     111%.d:
     112        @touch $@
     113
    103114perfexp--% : driver--%.o observation.o
    104         $(COMPILER) $^ -o $@
     115        $(COMPILER) $(EXTRA_COMP_FLAGS) $^ -o $@
    105116
    106117driver--%.o : driver.c
    107         $(COMPILER) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
     118        $(COMPILER) $(EXTRA_COMP_FLAGS) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
     119
     120sayhi:
     121        echo $(PERFPROGS)
    108122
    109123
    110 
    111 
    112 RUN_NUM_REPS=3
    113124RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)})              # 1 2 3
    114125RUN_REP_EXTS=$(call cross3,,run,$(RUN_REP_IDS),.1csv)       # run1.1csv run2.1cav run3.1csv
     
    146157.PRECIOUS: result--%.1csv driver--%.o perfexp--% %.o
    147158
    148 
    149159-include *.d
  • doc/theses/mike_brooks_MMath/benchmarks/list/_classic.c

    rbb7422a re02e13f  
    171171#endif
    172172
    173 
    174 #define Repeat( op ) for ( volatile unsigned int i = 0; i < NoOfNodes; i += 1 ) { op; }
     173volatile unsigned int t = 0;
     174volatile unsigned int i_official = 0;
     175
     176#define Repeat( op ) for ( unsigned int i = 0; (i_official = i, i < NoOfNodes); i += 1 ) { op; }
    175177
    176178int main() {
     
    192194        TAILQ_INIT(&lst);
    193195        start = clock();
    194         for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
     196        for ( t = 0; t < Times; t += 1 ) {
    195197                Repeat( TAILQ_INSERT_TAIL( &lst, &s[i], x ) );
    196198                Repeat( TAILQ_REMOVE( &lst, TAILQ_FIRST( &lst ), x ) );
     
    204206        std::list<S *> lst;
    205207        start = clock();
    206         for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
     208        for ( t = 0; t < Times; t += 1 ) {
    207209                Repeat( lst.push_back( &s[i] ) );
    208210                Repeat( lst.pop_front() );
     
    216218        uSequence<S> lst;
    217219        start = clock();
    218         for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
     220        for ( t = 0; t < Times; t += 1 ) {
    219221                Repeat( lst.addTail( &s[i] ) );
    220222                Repeat( lst.dropHead() );
     
    228230        dlist(S) lst;
    229231        start = clock();
    230         for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
     232        for ( t = 0; t < Times; t += 1 ) {
    231233                Repeat( insert_last( lst, s[i] ) );
    232234                Repeat( remove( lst`first ) );
     
    240242        Sequence(S) lst;
    241243        start = clock();
    242         for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
     244        for ( t = 0; t < Times; t += 1 ) {
    243245                Repeat( addHead( lst, s[i] ) );
    244246                Repeat( dropTail( lst ) );
  • doc/theses/mike_brooks_MMath/benchmarks/list/driver.c

    rbb7422a re02e13f  
    1717
    1818#if defined(NDEBUG) || (defined(__cforall) && !defined(__CFA_DEBUG__))
    19     enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheckClockFreq = 1000, DefaultExperimentDurOpCount = -1 };
     19    enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheckDoneFreq = 1000, DefaultExperimentDurOpCount = -1 };
    2020    #define TRACE(tp)
    2121#else
    22     enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckClockFreq = 2, DefaultExperimentDurOpCount = 20 };
     22    enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckDoneFreq = 2, DefaultExperimentDurOpCount = 20 };
    2323    static const char * tp_filter
    2424    // = "";
     
    7272)
    7373
     74unsigned int uDefaultPreemption() {
     75        return 0;
     76}
     77
    7478int main(int argc, const char *argv[]) {
    7579
    7680
    77     const char * usage_args = "[ExperimentDurSec [CheckClockFreq [NumNodes [ExperimentDurOpCount]]]]";
     81    const char * usage_args = "[ExperimentDurSec [CheckDoneFreq [NumNodes [ExperimentDurOpCount]]]]";
    7882    const int static_arg_posns = 4;
    7983
    8084    unsigned int ExperimentDurSec     = DefaultExperimentDurSec;
    81     unsigned int CheckClockFreq       = DefaultCheckClockFreq;
     85    unsigned int CheckDoneFreq       = DefaultCheckDoneFreq;
    8286    unsigned int NumNodes             = DefaultNumNodes;
    8387    size_t       ExperimentDurOpCount = DefaultExperimentDurOpCount;
    8488
    85     switch ((argc < static_arg_posns) ? argc : static_arg_posns) {
    86       case 5: ExperimentDurOpCount = atoi(argv[4]);
    87       case 4: NumNodes = atoi(argv[3]);
    88       case 3: CheckClockFreq = atoi(argv[2]);
    89       case 2: ExperimentDurSec = atoi(argv[1]);
     89    switch (((argc - 1) < static_arg_posns) ? (argc - 1) : static_arg_posns) {
     90      case 4: ExperimentDurOpCount = atol(argv[4]);
     91      case 3: NumNodes = atoi(argv[3]);
     92      case 2: CheckDoneFreq = atoi(argv[2]);
     93      case 1: ExperimentDurSec = atoi(argv[1]);
    9094    }
    9195
    92     if (ExperimentDurSec == 0 || CheckClockFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) {
     96    if (ExperimentDurSec == 0 || CheckDoneFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) {
    9397        printf("usage: %s %s\n", argv[0], usage_args);
    9498        return -1;
    9599    }
     100
     101  #ifdef DISABLE_CLOCK_RECHECK
     102    if (ExperimentDurSec != -1) {
     103        printf("Error: experiment compiled as fixed-work only.  ExperimentDurSec (currently %d) must be set to -1.\nUsage: %s %s\n", ExperimentDurSec, argv[0], usage_args);
     104        return -1;
     105    }
     106  #endif
    96107
    97108    ui = (B_UserItem*) malloc( NumNodes * sizeof(B_UserItem) );
     
    130141
    131142    while (elapsed_sec <= (double) ExperimentDurSec && bobs_ops_completed < ExperimentDurOpCount) {
    132         for ( int t = 0; t < CheckClockFreq; t += 1 ) {
     143        for ( int t = 0; t < CheckDoneFreq; t += 1 ) {
    133144            TRACE('a')
    134145            listedItems[0] =
     
    166177            TRACE('g')
    167178        }
     179      #ifndef DISABLE_CLOCK_RECHECK
     180        clock_t end = clock();
     181        elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC);
     182      #endif
     183    }
     184    #ifdef DISABLE_CLOCK_RECHECK
     185    {
    168186        clock_t end = clock();
    169187        elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC);
    170188    }
     189    #endif
    171190
    172191    double mean_op_dur_ns = elapsed_sec / ((double)bobs_ops_completed) * 1000 * 1000 * 1000;
Note: See TracChangeset for help on using the changeset viewer.