Skip to content

Commit

Permalink
[bfs] use nowait to reduce barriers
Browse files Browse the repository at this point in the history
  • Loading branch information
sbeamer committed Jun 14, 2021
1 parent 70a4d8b commit fe98b07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int64_t TDStep(const Graph &g, pvector<NodeID> &parent,
#pragma omp parallel
{
QueueBuffer<NodeID> lqueue(queue);
#pragma omp for reduction(+ : scout_count)
#pragma omp for reduction(+ : scout_count) nowait
for (auto q_iter = queue.begin(); q_iter < queue.end(); q_iter++) {
NodeID u = *q_iter;
for (NodeID v : g.out_neigh(u)) {
Expand Down Expand Up @@ -102,7 +102,7 @@ void BitmapToQueue(const Graph &g, const Bitmap &bm,
#pragma omp parallel
{
QueueBuffer<NodeID> lqueue(queue);
#pragma omp for
#pragma omp for nowait
for (NodeID n=0; n < g.num_nodes(); n++)
if (bm.get_bit(n))
lqueue.push_back(n);
Expand Down

0 comments on commit fe98b07

Please sign in to comment.