- Timestamp:
- Jan 21, 2021, 1:46:29 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c2df3031
- Parents:
- 2fab24e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/options.cfa
r2fab24e3 ra6b587f 9 9 } 10 10 11 #include <bitmanip.hfa> 11 12 #include <fstream.hfa> 12 13 #include <kernel.hfa> … … 51 52 bool iokpoll = false; 52 53 unsigned sublen = 16; 54 unsigned nentries = 16; 55 53 56 54 57 static cfa_option opt[] = { … … 68 71 { 'i', "kpollcomplete", "If set, cluster uses IORING_SETUP_IOPOLL", iokpoll, parse_settrue }, 69 72 {'\0', "submitlength", "Max number of submitions that can be submitted together", sublen }, 73 {'\0', "numentries", "Number of I/O entries", nentries }, 70 74 71 75 }; … … 74 78 char **left; 75 79 parse_args( argc, argv, opt, opt_cnt, "[OPTIONS]... [PATH]\ncforall http server", left ); 80 81 if( !is_pow2(nentries) ) { 82 unsigned v = nentries; 83 v--; 84 v |= v >> 1; 85 v |= v >> 2; 86 v |= v >> 4; 87 v |= v >> 8; 88 v |= v >> 16; 89 v++; 90 serr | "Warning: num_entries not a power of 2" | '(' | nentries | ')' | "raising to " | v; 91 nentries = v; 92 } 93 options.clopts.params.num_entries = nentries; 76 94 77 95 options.clopts.params.poller_submits = subthrd; … … 94 112 options.clopts.params.num_ready = sublen; 95 113 96 if( left[0] == 0p ) { return "."; }114 if( left[0] == 0p ) { return; } 97 115 98 116 const char * path = left[0]; … … 100 118 101 119 if( left[0] != 0p ) { 102 serr | "Too many trailing arguments!"; 120 serr | "Too many trailing arguments!" | '\'' | path | '\''; 121 while(left[0] != 0p) { 122 serr | " - " | left[0]; 123 left++; 124 } 103 125 exit(EXIT_FAILURE); 104 126 }
Note: See TracChangeset
for help on using the changeset viewer.