Changeset 566fde0


Ignore:
Timestamp:
Jun 25, 2020, 2:31:49 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
cb85603
Parents:
69fbc61
Message:

Updated benchmark Stats options

Location:
benchmark
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/readv.cfa

    r69fbc61 r566fde0  
    1616#include <thread.hfa>
    1717#include <time.hfa>
     18#include <stats.hfa>
    1819
    1920#include "../benchcltr.hfa"
     
    5253        unsigned long int nthreads = 2;
    5354        unsigned long int nprocs   = 1;
     55        bool silent = false;
     56        bool procstats = false;
    5457        unsigned flags = 0;
    5558        unsigned sublen = 16;
     
    6164                        {"nthreads",     required_argument, 0, 't'},
    6265                        {"nprocs",       required_argument, 0, 'p'},
     66                        {"nostats",      no_argument      , 0, 'S'},
     67                        {"procstat",     no_argument      , 0, 'P'},
    6368                        {"bufsize",      required_argument, 0, 'b'},
    6469                        {"userthread",   no_argument      , 0, 'u'},
     
    6974
    7075                int idx = 0;
    71                 int opt = getopt_long(argc, argv, "d:t:p:b:usl:", options, &idx);
     76                int opt = getopt_long(argc, argv, "d:t:p:SPb:usl:", options, &idx);
    7277
    7378                const char * arg = optarg ? optarg : "";
     
    99104                                }
    100105                                break;
     106                        case 'S':
     107                                silent = true;
     108                                break;
     109                        case 'P':
     110                                procstats = true;
     111                                break;
    101112                        case 'b':
    102113                                buflen = strtoul(arg, &end, 10);
     
    124135                                fprintf(stderr, "%d\n", opt);
    125136                        usage:
    126                                 fprintf(stderr, "Usage: %s : [options]\n", argv[0]);
    127                                 fprintf(stderr, "\n");
    128                                 fprintf(stderr, "  -d, --duration=DURATION  Duration of the experiment, in seconds\n");
    129                                 fprintf(stderr, "  -t, --nthreads=NTHREADS  Number of user threads\n");
    130                                 fprintf(stderr, "  -p, --nprocs=NPROCS      Number of kernel threads\n");
    131                                 fprintf(stderr, "  -b, --buflen=SIZE        Number of bytes to read per request\n");
    132                                 fprintf(stderr, "  -u, --userthread         If set, cluster uses user-thread to poll I/O\n");
    133                                 fprintf(stderr, "  -s, --submitthread       If set, cluster uses polling thread to submit I/O\n");
     137                                fprintf( stderr, "Usage: %s : [options]\n", argv[0] );
     138                                fprintf( stderr, "\n" );
     139                                fprintf( stderr, "  -d, --duration=DURATION  Duration of the experiment, in seconds\n" );
     140                                fprintf( stderr, "  -t, --nthreads=NTHREADS  Number of user threads\n" );
     141                                fprintf( stderr, "  -p, --nprocs=NPROCS      Number of kernel threads\n" );
     142                                fprintf( stderr, "  -S, --nostats            Don't print cluster stats\n" );
     143                                fprintf( stderr, "  -P, --procstat           Print processor stats" );
     144                                fprintf( stderr, "  -b, --buflen=SIZE        Number of bytes to read per request\n" );
     145                                fprintf( stderr, "  -u, --userthread         If set, cluster uses user-thread to poll I/O\n" );
     146                                fprintf( stderr, "  -s, --submitthread       If set, cluster uses polling thread to submit I/O\n" );
    134147                                exit(EXIT_FAILURE);
    135148                }
     
    148161                BenchCluster cl = { flags };
    149162                #if !defined(__CFA_NO_STATISTICS__)
    150                         print_stats_at_exit( cl.self );
     163                        if( !silent ) {
     164                                print_stats_at_exit( cl.self, CFA_STATS_READY_Q | CFA_STATS_IO );
     165                        }
    151166                #endif
    152167                {
    153168                        BenchProc procs[nprocs];
     169                        #if !defined(__CFA_NO_STATISTICS__)
     170                                if( procstats ) {
     171                                        for(i; nprocs) {
     172                                                print_stats_at_exit( procs[i].self, CFA_STATS_READY_Q | CFA_STATS_IO );
     173                                        }
     174                                }
     175                        #endif
    154176                        {
    155177                                Reader threads[nthreads];
  • benchmark/readyQ/yield.cfa

    r69fbc61 r566fde0  
    1313#include <clock.hfa>
    1414#include <time.hfa>
     15#include <stats.hfa>
    1516
    1617#include "../benchcltr.hfa"
     
    4546        int nprocs = 1;
    4647        int nthreads = 1;
    47 
    48 
     48        bool silent = false;
     49        bool procstats = false;
    4950
    5051        for(;;) {
     
    5354                        {"nprocs",    required_argument, 0, 'p'},
    5455                        {"nthreads",  required_argument, 0, 't'},
     56                        {"nostats",   no_argument      , 0, 'S'},
     57                        {"procstat",  no_argument      , 0, 'P'},
    5558                        {0, 0, 0, 0}
    5659                };
    5760
    5861                int idx = 0;
    59                 int opt = getopt_long(argc, argv, "d:p:t:", options, &idx);
     62                int opt = getopt_long(argc, argv, "d:p:t:SP", options, &idx);
    6063
    6164                char * arg = optarg ? optarg : "";
     
    8790                                }
    8891                                break;
     92                        case 'S':
     93                                silent = true;
     94                                break;
     95                        case 'P':
     96                                procstats = true;
     97                                break;
    8998                        // Other cases
    9099                        default: /* ? */
     
    96105                                fprintf( stderr, "  -t, --nthreads=NTHREADS  Number of kernel threads\n" );
    97106                                fprintf( stderr, "  -q, --nqueues=NQUEUES    Number of queues per threads\n" );
     107                                fprintf( stderr, "  -S, --nostats            Don't print cluster stats\n" );
     108                                fprintf( stderr, "  -P, --procstat           Print processor stats" );
    98109                                exit(1);
    99110                }
     
    107118                BenchCluster cl = { 0 };
    108119                #if !defined(__CFA_NO_STATISTICS__)
    109                         print_stats_at_exit( cl.self );
     120                        if( !silent ) {
     121                                print_stats_at_exit( cl.self, CFA_STATS_READY_Q );
     122                        }
    110123                #endif
    111124                {
    112125                        BenchProc procs[nprocs];
    113126                        #if !defined(__CFA_NO_STATISTICS__)
    114                                 for(i; nprocs) {
    115                                         print_stats_at_exit( procs[i].self );
     127                                if( procstats ) {
     128                                        for(i; nprocs) {
     129                                                print_stats_at_exit( procs[i].self, CFA_STATS_READY_Q );
     130                                        }
    116131                                }
    117132                        #endif
Note: See TracChangeset for help on using the changeset viewer.