Changeset c921712 for doc/theses/thierry_delisle_PhD
- Timestamp:
- Sep 27, 2019, 11:07:56 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c3a2007
- Parents:
- 1e24d13
- Location:
- doc/theses/thierry_delisle_PhD/code
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/thierry_delisle_PhD/code/relaxed_list.cpp
r1e24d13 rc921712 2 2 3 3 #include <array> 4 #include <iomanip> 4 5 #include <iostream> 5 6 #include <locale> … … 104 105 105 106 // Prep nodes 106 std::cout << "Initializing" << std::endl; 107 std::cout << "Initializing "; 108 size_t nnodes = 0; 109 size_t npushed = 0; 107 110 NodeArray all_nodes[nthread]; 108 111 for(auto & nodes : all_nodes) { … … 110 113 for(auto & node : nodes.array) { 111 114 auto r = rand.next() % 100; 112 if(r < fill) 115 if(r < fill) { 113 116 node = new Node(rand.next() % 100); 114 else 117 nnodes++; 118 } else { 115 119 node = nullptr; 120 } 116 121 } 117 122 … … 121 126 global.crc_in += node->value; 122 127 list.push(node); 128 npushed++; 123 129 nodes.array[idx] = nullptr; 124 130 } 125 131 } 126 132 } 133 134 std::cout << nnodes << " nodes " << fill << "% (" << npushed << " pushed)" << std::endl; 127 135 128 136 enable_stats = true; … … 179 187 break; 180 188 } 181 std::cout << "\r" << durr.count() << "/" << duration;189 std::cout << "\r" << std::setprecision(4) << durr.count(); 182 190 std::cout.flush(); 183 191 } … … 187 195 duration_t durr = after - before; 188 196 duration = durr.count(); 189 std::cout << "\ nClosing down" << std::endl;197 std::cout << "\rClosing down" << std::endl; 190 198 191 199 for(auto t : threads) { … … 241 249 { 242 250 case 5: 243 nqueues= std::stoul(argv[4]);251 fill = std::stoul(argv[4]); 244 252 [[fallthrough]]; 245 253 case 4: -
doc/theses/thierry_delisle_PhD/code/relaxed_list.hpp
r1e24d13 rc921712 74 74 #ifndef NO_STATS 75 75 std::cout << "Difference : " 76 << s ize_t(double(intrusive_queue_t::stat::dif.value) / intrusive_queue_t::stat::dif.num ) << " avg\t"76 << ssize_t(double(intrusive_queue_t::stat::dif.value) / intrusive_queue_t::stat::dif.num ) << " avg\t" 77 77 << intrusive_queue_t::stat::dif.max << "max" << std::endl; 78 78 #endif … … 200 200 stat::dif.value+= s.diff; 201 201 stat::dif.num ++; 202 stat::dif.max = std:: max(stat::dif.max, s.diff);202 stat::dif.max = std::abs(stat::dif.max) > std::abs(s.diff) ? stat::dif.max : s.diff; 203 203 #endif 204 204 }
Note: See TracChangeset
for help on using the changeset viewer.