Changeset 1791 for proto/SymbolTable


Ignore:
Timestamp:
Dec 17, 2011, 3:23:46 PM (8 years ago)
Author:
vla24
Message:

Added some macro for easy PAPI performance testing

Location:
proto/SymbolTable
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/build_wcd.sh

    r1787 r1791  
    1 cd src && make wcd && python run_wcd.py ../test/test_files/blank ../test/test_files/wcd_tale_of_two_cities.txt && cd ..
     1cd src && make wcd && python run_wcd.py ../test/test_files/wcd_blank.txt ../test/test_files/wcd_the_republic_by_plato.txt && cd ..
  • proto/SymbolTable/common_definitions.h

    r1787 r1791  
    88#define SIMD_type BitBlock
    99#define DEBUG 0
    10 #define PRINT_SYMBOL_DISTRIBUTION 0
     10#define PRINT_SYMBOL_DISTRIBUTION 1
    1111#define PRINT_DICTIONARY_INFO 0
    1212#define SEGMENT_BLOCKS 12
    1313#define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    1414#define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
     15
     16#if defined(L1_PERF) || defined(L2_PERF)
     17#define CACHE_PERF
     18#endif
    1519
    1620#include <stdio.h>
  • proto/SymbolTable/symtab_hash_template.cpp

    r1786 r1791  
    1111        #define NUM_EVENTS 1
    1212//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    13 //      int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     13
     14#ifdef L1_PERF
     15        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     16#elif L2_PERF
    1417        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
    15 //      int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     18#else
     19        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     20#endif
    1621        //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
    1722        int cal_size = 20;
  • proto/SymbolTable/symtab_identity_template.cpp

    r1786 r1791  
    1111        #define NUM_EVENTS 1
    1212//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    13 //      int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
    1416        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
    15 //      int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
    1721        int cal_size = 20;
  • proto/SymbolTable/symtab_ls_template.cpp

    r1786 r1791  
    1111        #define NUM_EVENTS 1
    1212        //      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    13 //              int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    14                 int Events[NUM_EVENTS] = {PAPI_L1_DCM};
    15 //              int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
  • proto/SymbolTable/symtab_pbgs_div_template.cpp

    r1786 r1791  
    1111        #define NUM_EVENTS 1
    1212        //      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    13 //              int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    14                 int Events[NUM_EVENTS] = {PAPI_L1_DCM};
    15 //              int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
  • proto/SymbolTable/symtab_pbgs_identity_template.cpp

    r1786 r1791  
    1212        #define NUM_EVENTS 1
    1313//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14 //      int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     14#ifdef L1_PERF
     15        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     16#elif L2_PERF
    1517        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
    16 //      int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     18#else
     19        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     20#endif
    1721        int cal_size = 20;
    1822        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
  • proto/SymbolTable/symtab_pbgs_log_template.cpp

    r1786 r1791  
    1313        #define NUM_EVENTS 1
    1414//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    15 //      int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    16 //      int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     15#ifdef L1_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     17#elif L2_PERF
     18        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     19#else
    1720        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     21#endif
    1822        int cal_size = 20;
    1923        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
  • proto/SymbolTable/symtab_stl_template.cpp

    r1786 r1791  
    1111        #define NUM_EVENTS 1
    1212//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    13 //      int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
    1416        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
    15 //      int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
  • proto/SymbolTable/test/test_files/wcd_a_sailor_of_king_george.txt

    r1741 r1791  
    87298729
    87308730***FINIS***
    8731 
  • proto/SymbolTable/wcd_hash_template.cpp

    r1777 r1791  
    1111#elif CODE_CLOCKER
    1212        #define NUM_EVENTS 1
    13         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    15         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     13//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
     14#ifdef L1_PERF
     15        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     16#elif L2_PERF
     17        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     18#else
     19        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     20#endif
    1621        int cal_size = 20;
    1722        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    181186      if (allow_performance_check)
    182187      {
    183         PERF_SEC_END(parser_timer, chars_avail);
     188#ifndef CACHE_PERF
     189         PERF_SEC_END(parser_timer, chars_avail);
     190#else
     191         PERF_SEC_END(parser_timer, 1);
     192#endif
    184193      }
    185194      int bytes_left = chars_read - chars_avail;
     
    226235    if (allow_performance_check)
    227236    {
    228         PERF_SEC_END(parser_timer, chars_avail);
    229     }
    230 }
     237#ifndef CACHE_PERF
     238         PERF_SEC_END(parser_timer, chars_avail);
     239#else
     240         PERF_SEC_END(parser_timer, 1);
     241#endif
     242    }
     243}
  • proto/SymbolTable/wcd_identity_template.cpp

    r1721 r1791  
    1111#elif CODE_CLOCKER
    1212        #define NUM_EVENTS 1
    13         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    15         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     13//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
     14#ifdef L1_PERF
     15        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     16#elif L2_PERF
     17        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     18#else
     19        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     20#endif
    1621        int cal_size = 20;
    1722        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    258263      if (allow_performance_check)
    259264      {
    260         PERF_SEC_END(parser_timer, chars_avail);
     265#ifndef CACHE_PERF
     266         PERF_SEC_END(parser_timer, chars_avail);
     267#else
     268         PERF_SEC_END(parser_timer, 1);
     269#endif
    261270      }
    262271      int bytes_left = chars_read - chars_avail;
     
    296305    if (allow_performance_check)
    297306    {
    298         PERF_SEC_END(parser_timer, chars_avail);
    299     }
    300 }
     307#ifndef CACHE_PERF
     308         PERF_SEC_END(parser_timer, chars_avail);
     309#else
     310         PERF_SEC_END(parser_timer, 1);
     311#endif
     312    }
     313}
  • proto/SymbolTable/wcd_pbgs_div_template.cpp

    r1741 r1791  
    1111#elif CODE_CLOCKER
    1212        #define NUM_EVENTS 1
    13         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    15         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    301305      if (allow_performance_check)
    302306      {
    303         PERF_SEC_END(parser_timer, chars_avail);
     307#ifndef CACHE_PERF
     308         PERF_SEC_END(parser_timer, chars_avail);
     309#else
     310         PERF_SEC_END(parser_timer, 1);
     311#endif
    304312      }
    305313      int bytes_left = chars_read - chars_avail;
     
    339347    if (allow_performance_check)
    340348    {
    341         PERF_SEC_END(parser_timer, chars_avail);
    342     }
    343 }
     349#ifndef CACHE_PERF
     350         PERF_SEC_END(parser_timer, chars_avail);
     351#else
     352         PERF_SEC_END(parser_timer, 1);
     353#endif
     354    }
     355}
  • proto/SymbolTable/wcd_pbgs_identity_template.cpp

    r1741 r1791  
    1111#elif CODE_CLOCKER
    1212        #define NUM_EVENTS 1
    13         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    15         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    303307      if (allow_performance_check)
    304308      {
    305         PERF_SEC_END(parser_timer, chars_avail);
     309#ifndef CACHE_PERF
     310         PERF_SEC_END(parser_timer, chars_avail);
     311#else
     312         PERF_SEC_END(parser_timer, 1);
     313#endif
    306314      }
    307315      int bytes_left = chars_read - chars_avail;
     
    341349    if (allow_performance_check)
    342350    {
    343         PERF_SEC_END(parser_timer, chars_avail);
    344     }
    345 }
     351#ifndef CACHE_PERF
     352         PERF_SEC_END(parser_timer, chars_avail);
     353#else
     354         PERF_SEC_END(parser_timer, 1);
     355#endif
     356    }
     357}
  • proto/SymbolTable/wcd_pbgs_log_template.cpp

    r1721 r1791  
    1313#elif CODE_CLOCKER
    1414        #define NUM_EVENTS 1
    15         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    16         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    17         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     15#ifdef L1_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     17#elif L2_PERF
     18        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     19#else
     20        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     21#endif
    1822        int cal_size = 20;
    1923        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    357361      if (allow_performance_check)
    358362      {
    359         PERF_SEC_END(parser_timer, chars_avail);
     363#ifndef CACHE_PERF
     364         PERF_SEC_END(parser_timer, chars_avail);
     365#else
     366         PERF_SEC_END(parser_timer, 1);
     367#endif
    360368      }
    361369      int bytes_left = chars_read - chars_avail;
     
    370378    if (allow_performance_check)
    371379    {
    372         PERF_SEC_START(parser_timer);
     380#ifndef CACHE_PERF
     381         PERF_SEC_END(parser_timer, chars_avail);
     382#else
     383         PERF_SEC_END(parser_timer, 1);
     384#endif
    373385    }
    374386
  • proto/SymbolTable/wcd_stl_template.cpp

    r1777 r1791  
    1111#elif CODE_CLOCKER
    1212        #define NUM_EVENTS 1
    13         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    15         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    190194      if (allow_performance_check)
    191195      {
    192         PERF_SEC_END(parser_timer, chars_avail);
     196#ifndef CACHE_PERF
     197         PERF_SEC_END(parser_timer, chars_avail);
     198#else
     199         PERF_SEC_END(parser_timer, 1);
     200#endif
    193201      }
    194202
     
    240248    if (allow_performance_check)
    241249    {
    242       PERF_SEC_END(parser_timer, chars_avail);
    243     }
    244 }
     250#ifndef CACHE_PERF
     251         PERF_SEC_END(parser_timer, chars_avail);
     252#else
     253         PERF_SEC_END(parser_timer, 1);
     254#endif
     255    }
     256}
Note: See TracChangeset for help on using the changeset viewer.