extractUChunch optimization

omp-walther
StefanoPetrilli 2 years ago
parent 500403dbda
commit a259e8ab53

@ -11,14 +11,18 @@ void extractUChunk(
{ {
if (U.empty() && !privateU.empty()) // If U is empty but there are nodes in private U if (U.empty() && !privateU.empty()) // If U is empty but there are nodes in private U
{
while (!privateU.empty()) while (!privateU.empty())
U.push_back(privateU.pop_front()); UChunkBeingProcessed.push_back(privateU.pop_back());
}
for (int i = 0; i < UCHUNK; i++) else
{ // Pop the new nodes {
if (U.empty()) for (int i = 0; i < UCHUNK; i++)
break; { // Pop the new nodes
UChunkBeingProcessed.push_back(U.pop_front()); if (U.empty())
break;
UChunkBeingProcessed.push_back(U.pop_back());
}
} }
} // End of critical U } // End of critical U

Loading…
Cancel
Save