File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ struct benchmark_bfs : benchmark_timed<> {
291
291
long long pushed_nodes{ 0 };
292
292
long long ignored_nodes{ 0 };
293
293
long long processed_nodes{ 0 };
294
+ bool err{ false };
294
295
};
295
296
296
297
#ifdef __GNUC__
@@ -331,7 +332,7 @@ struct benchmark_bfs : benchmark_timed<> {
331
332
while (d < old_d) {
332
333
if (distances[target].value .compare_exchange_weak (old_d, d, std::memory_order_relaxed)) {
333
334
if (!handle.push ((static_cast <std::uint64_t >(d) << 32 ) | target)) {
334
- throw std::runtime_error ( " Push failed! " ) ;
335
+ counter. err = true ;
335
336
}
336
337
++counter.pushed_nodes ;
337
338
break ;
@@ -368,9 +369,15 @@ struct benchmark_bfs : benchmark_timed<> {
368
369
sum.pushed_nodes += counter.pushed_nodes ;
369
370
sum.processed_nodes += counter.processed_nodes ;
370
371
sum.ignored_nodes += counter.ignored_nodes ;
372
+ sum.err |= counter.err ;
371
373
return sum;
372
374
});
373
375
376
+ if (total_counts.err ) {
377
+ stream << " ERR" ;
378
+ return ;
379
+ }
380
+
374
381
auto longest_distance =
375
382
std::max_element (distances.begin (), distances.end (), [](auto const & a, auto const & b) {
376
383
auto a_val = a.value .load (std::memory_order_relaxed);
You can’t perform that action at this time.
0 commit comments