Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/readv.cfa

    rcbabfd4 r4069faad  
    1616#include <thread.hfa>
    1717#include <time.hfa>
     18
     19#if !defined(HAVE_LINUX_IO_URING_H)
     20#warning no io uring
     21#endif
    1822
    1923extern bool traceHeapOn();
     
    4953        while(__atomic_load_n(&run, __ATOMIC_RELAXED)) {
    5054                int r = cfa_preadv2(fd, &iov, 1, 0, 0);
    51                 if(r < 0) abort("%s\n", strerror(-r));
     55                if(r < 0) abort(strerror(-r));
    5256
    5357                __atomic_fetch_add( &count, 1, __ATOMIC_SEQ_CST );
     
    5963        unsigned long int nthreads = 2;
    6064        unsigned long int nprocs   = 1;
    61         int flags = 0;
     65
     66        printf("Setting local\n");
     67        setlocale(LC_NUMERIC, "");
    6268
    6369        arg_loop:
    6470        for(;;) {
    6571                static struct option options[] = {
    66                         {"duration",   required_argument, 0, 'd'},
    67                         {"nthreads",   required_argument, 0, 't'},
    68                         {"nprocs",     required_argument, 0, 'p'},
    69                         {"bufsize",    required_argument, 0, 'b'},
    70                         {"userthread", no_argument      , 0, 'u'},
     72                        {"duration",  required_argument, 0, 'd'},
     73                        {"nthreads",  required_argument, 0, 't'},
     74                        {"nprocs",    required_argument, 0, 'p'},
     75                        {"bufsize",   required_argument, 0, 'b'},
    7176                        {0, 0, 0, 0}
    7277                };
    7378
    7479                int idx = 0;
    75                 int opt = getopt_long(argc, argv, "d:t:p:b:u", options, &idx);
     80                int opt = getopt_long(argc, argv, "d:t:p:b:", options, &idx);
    7681
    7782                const char * arg = optarg ? optarg : "";
     
    110115                                }
    111116                                break;
    112                         case 'u':
    113                                 flags |= CFA_CLUSTER_IO_POLLER_USER_THREAD;
    114                                 break;
    115117                        // Other cases
    116118                        default: /* ? */
     
    133135        }
    134136
    135         printf("Running %lu threads, reading %lu bytes each, over %lu processors for %lf seconds\n", nthreads, buflen, nprocs, duration);
     137        printf("Running %lu threads over %lu processors for %lf seconds\n", nthreads, nprocs, duration);
    136138
    137139        {
    138140                Time start, end;
    139                 cluster cl = { "IO Cluster", flags };
     141                cluster cl = { "IO Cluster" };
    140142                the_cluster = &cl;
    141143                #if !defined(__CFA_NO_STATISTICS__)
     
    159161                        }
    160162                }
    161                 printf("Took %'ld ms\n", (end - start)`ms);
    162                 printf("Total reads      : %'15zu\n", count);
    163                 printf("Reads per second : %'18.2lf\n", ((double)count) / (end - start)`s);
    164                 printf("Total read size  : %'15zu\n", buflen * count);
    165                 printf("Bytes per second : %'18.2lf\n", ((double)count * buflen) / (end - start)`s);
     163                printf("Took %ld ms\n", (end - start)`ms);
     164                printf("Total reads:      %'zu\n", count);
     165                printf("Reads per second: %'lf\n", ((double)count) / (end - start)`s);
    166166        }
    167167
Note: See TracChangeset for help on using the changeset viewer.