Changes in benchmark/io/readv.cfa [cbabfd4:4069faad]
- File:
-
- 1 edited
-
benchmark/io/readv.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/readv.cfa
rcbabfd4 r4069faad 16 16 #include <thread.hfa> 17 17 #include <time.hfa> 18 19 #if !defined(HAVE_LINUX_IO_URING_H) 20 #warning no io uring 21 #endif 18 22 19 23 extern bool traceHeapOn(); … … 49 53 while(__atomic_load_n(&run, __ATOMIC_RELAXED)) { 50 54 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)); 52 56 53 57 __atomic_fetch_add( &count, 1, __ATOMIC_SEQ_CST ); … … 59 63 unsigned long int nthreads = 2; 60 64 unsigned long int nprocs = 1; 61 int flags = 0; 65 66 printf("Setting local\n"); 67 setlocale(LC_NUMERIC, ""); 62 68 63 69 arg_loop: 64 70 for(;;) { 65 71 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'}, 71 76 {0, 0, 0, 0} 72 77 }; 73 78 74 79 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); 76 81 77 82 const char * arg = optarg ? optarg : ""; … … 110 115 } 111 116 break; 112 case 'u':113 flags |= CFA_CLUSTER_IO_POLLER_USER_THREAD;114 break;115 117 // Other cases 116 118 default: /* ? */ … … 133 135 } 134 136 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); 136 138 137 139 { 138 140 Time start, end; 139 cluster cl = { "IO Cluster" , flags};141 cluster cl = { "IO Cluster" }; 140 142 the_cluster = &cl; 141 143 #if !defined(__CFA_NO_STATISTICS__) … … 159 161 } 160 162 } 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); 166 166 } 167 167
Note:
See TracChangeset
for help on using the changeset viewer.