Changes in / [e02e13f:bb7422a]


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

Legend:

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

    re02e13f rbb7422a  
    1212UXX =  ~/u++/u++-7.0.0/bin/u++
    1313
    14 MODE=performance
    15 EXTRA_COMP_FLAGS=
    16 RUN_NUM_REPS=3
     14MODE = performance
    1715RUNARGS=
    1816
     
    103101perfexp--%     driver--%.o     : COMPILER=NO-COMPILER-FOR-$(FX_COARSE)
    104102
    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 
    114103perfexp--% : driver--%.o observation.o
    115         $(COMPILER) $(EXTRA_COMP_FLAGS) $^ -o $@
     104        $(COMPILER) $^ -o $@
    116105
    117106driver--%.o : driver.c
    118         $(COMPILER) $(EXTRA_COMP_FLAGS) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
    119 
    120 sayhi:
    121         echo $(PERFPROGS)
     107        $(COMPILER) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
    122108
    123109
     110
     111
     112RUN_NUM_REPS=3
    124113RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)})              # 1 2 3
    125114RUN_REP_EXTS=$(call cross3,,run,$(RUN_REP_IDS),.1csv)       # run1.1csv run2.1cav run3.1csv
     
    157146.PRECIOUS: result--%.1csv driver--%.o perfexp--% %.o
    158147
     148
    159149-include *.d
  • doc/theses/mike_brooks_MMath/benchmarks/list/_classic.c

    re02e13f rbb7422a  
    171171#endif
    172172
    173 volatile unsigned int t = 0;
    174 volatile unsigned int i_official = 0;
    175 
    176 #define Repeat( op ) for ( unsigned int i = 0; (i_official = i, i < NoOfNodes); i += 1 ) { op; }
     173
     174#define Repeat( op ) for ( volatile unsigned int i = 0; i < NoOfNodes; i += 1 ) { op; }
    177175
    178176int main() {
     
    194192        TAILQ_INIT(&lst);
    195193        start = clock();
    196         for ( t = 0; t < Times; t += 1 ) {
     194        for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
    197195                Repeat( TAILQ_INSERT_TAIL( &lst, &s[i], x ) );
    198196                Repeat( TAILQ_REMOVE( &lst, TAILQ_FIRST( &lst ), x ) );
     
    206204        std::list<S *> lst;
    207205        start = clock();
    208         for ( t = 0; t < Times; t += 1 ) {
     206        for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
    209207                Repeat( lst.push_back( &s[i] ) );
    210208                Repeat( lst.pop_front() );
     
    218216        uSequence<S> lst;
    219217        start = clock();
    220         for ( t = 0; t < Times; t += 1 ) {
     218        for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
    221219                Repeat( lst.addTail( &s[i] ) );
    222220                Repeat( lst.dropHead() );
     
    230228        dlist(S) lst;
    231229        start = clock();
    232         for ( t = 0; t < Times; t += 1 ) {
     230        for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
    233231                Repeat( insert_last( lst, s[i] ) );
    234232                Repeat( remove( lst`first ) );
     
    242240        Sequence(S) lst;
    243241        start = clock();
    244         for ( t = 0; t < Times; t += 1 ) {
     242        for ( volatile unsigned int t = 0; t < Times; t += 1 ) {
    245243                Repeat( addHead( lst, s[i] ) );
    246244                Repeat( dropTail( lst ) );
  • doc/theses/mike_brooks_MMath/benchmarks/list/driver.c

    re02e13f rbb7422a  
    1717
    1818#if defined(NDEBUG) || (defined(__cforall) && !defined(__CFA_DEBUG__))
    19     enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheckDoneFreq = 1000, DefaultExperimentDurOpCount = -1 };
     19    enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheckClockFreq = 1000, DefaultExperimentDurOpCount = -1 };
    2020    #define TRACE(tp)
    2121#else
    22     enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckDoneFreq = 2, DefaultExperimentDurOpCount = 20 };
     22    enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckClockFreq = 2, DefaultExperimentDurOpCount = 20 };
    2323    static const char * tp_filter
    2424    // = "";
     
    7272)
    7373
    74 unsigned int uDefaultPreemption() {
    75         return 0;
    76 }
    77 
    7874int main(int argc, const char *argv[]) {
    7975
    8076
    81     const char * usage_args = "[ExperimentDurSec [CheckDoneFreq [NumNodes [ExperimentDurOpCount]]]]";
     77    const char * usage_args = "[ExperimentDurSec [CheckClockFreq [NumNodes [ExperimentDurOpCount]]]]";
    8278    const int static_arg_posns = 4;
    8379
    8480    unsigned int ExperimentDurSec     = DefaultExperimentDurSec;
    85     unsigned int CheckDoneFreq       = DefaultCheckDoneFreq;
     81    unsigned int CheckClockFreq       = DefaultCheckClockFreq;
    8682    unsigned int NumNodes             = DefaultNumNodes;
    8783    size_t       ExperimentDurOpCount = DefaultExperimentDurOpCount;
    8884
    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]);
     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]);
    9490    }
    9591
    96     if (ExperimentDurSec == 0 || CheckDoneFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) {
     92    if (ExperimentDurSec == 0 || CheckClockFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) {
    9793        printf("usage: %s %s\n", argv[0], usage_args);
    9894        return -1;
    9995    }
    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
    10796
    10897    ui = (B_UserItem*) malloc( NumNodes * sizeof(B_UserItem) );
     
    141130
    142131    while (elapsed_sec <= (double) ExperimentDurSec && bobs_ops_completed < ExperimentDurOpCount) {
    143         for ( int t = 0; t < CheckDoneFreq; t += 1 ) {
     132        for ( int t = 0; t < CheckClockFreq; t += 1 ) {
    144133            TRACE('a')
    145134            listedItems[0] =
     
    177166            TRACE('g')
    178167        }
    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     {
    186168        clock_t end = clock();
    187169        elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC);
    188170    }
    189     #endif
    190171
    191172    double mean_op_dur_ns = elapsed_sec / ((double)bobs_ops_completed) * 1000 * 1000 * 1000;
Note: See TracChangeset for help on using the changeset viewer.