|
|
@ -72,6 +72,8 @@
|
|
|
|
Statistics: ph1_card, ph2_card : Size: |P| number of processes in the comm-world (number of matched edges in Phase 1 and Phase 2)
|
|
|
|
Statistics: ph1_card, ph2_card : Size: |P| number of processes in the comm-world (number of matched edges in Phase 1 and Phase 2)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define UCHUNK 1000
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SERIAL_MPI
|
|
|
|
#ifdef SERIAL_MPI
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
//MPI type map
|
|
|
|
//MPI type map
|
|
|
@ -658,20 +660,38 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
|
|
|
|
MilanLongInt localVertices = 0;
|
|
|
|
MilanLongInt localVertices = 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
while( true )
|
|
|
|
//TODO what would be the optimal UCHUNK
|
|
|
|
{
|
|
|
|
vector <MilanLongInt> Us;
|
|
|
|
|
|
|
|
Us.reserve(UCHUNK);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while( true ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Us.clear();
|
|
|
|
#pragma omp critical(U)
|
|
|
|
#pragma omp critical(U)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (U.empty()) isEmpty = true;
|
|
|
|
//If U is emptu and there are no new node to add to U
|
|
|
|
else u = U.pop_front();
|
|
|
|
if (U.empty() && privateU.empty())
|
|
|
|
|
|
|
|
isEmpty = true;
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (U.empty() && !privateU.empty()) // If U is empty but there are nodes in private U
|
|
|
|
|
|
|
|
while (!privateU.empty()) {
|
|
|
|
|
|
|
|
U.push_back(privateU.pop_front());
|
|
|
|
|
|
|
|
myCard += privateMyCard;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < UCHUNK; i++) { // Pop the new nodes
|
|
|
|
|
|
|
|
if (U.empty()) break;
|
|
|
|
|
|
|
|
Us.push_back(U.pop_front());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} // End of critical U
|
|
|
|
} // End of critical U
|
|
|
|
if (isEmpty) break;
|
|
|
|
if (isEmpty) break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (MilanLongInt u : Us)
|
|
|
|
|
|
|
|
{
|
|
|
|
#ifdef PRINT_DEBUG_INFO_
|
|
|
|
#ifdef PRINT_DEBUG_INFO_
|
|
|
|
cout<<"\n("<<myRank<<")u: "<<u; fflush(stdout);
|
|
|
|
cout<<"\n("<<myRank<<")u: "<<u; fflush(stdout);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if ( (u >= StartIndex) && (u <= EndIndex) ) { //Process Only the Local Vertices
|
|
|
|
if ((u >= StartIndex) && (u <= EndIndex)) { //Process Only the Local Vertices
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef COUNT_LOCAL_VERTEX
|
|
|
|
#ifdef COUNT_LOCAL_VERTEX
|
|
|
|
localVertices ++;
|
|
|
|
localVertices ++;
|
|
|
@ -847,15 +867,17 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
|
|
|
|
} //End of if ( (u >= StartIndex) && (u <= EndIndex) ) //Process Only If a Local Vertex
|
|
|
|
} //End of if ( (u >= StartIndex) && (u <= EndIndex) ) //Process Only If a Local Vertex
|
|
|
|
|
|
|
|
|
|
|
|
//Avoid to ask for the critical section if there is nothing to add
|
|
|
|
//Avoid to ask for the critical section if there is nothing to add
|
|
|
|
if(privateU.empty()) continue;
|
|
|
|
if (privateU.size() < UCHUNK && !U.empty()) continue;
|
|
|
|
#pragma omp critical(U)
|
|
|
|
#pragma omp critical(U)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
while(!privateU.empty()) {
|
|
|
|
while (!privateU.empty()) {
|
|
|
|
U.push_back(privateU.pop_front());
|
|
|
|
U.push_back(privateU.pop_front());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
myCard += privateMyCard;
|
|
|
|
myCard += privateMyCard;
|
|
|
|
} //End of critical U
|
|
|
|
} //End of critical U
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} //End of while ( /*!Q.empty()*/ !U.empty() )
|
|
|
|
} //End of while ( /*!Q.empty()*/ !U.empty() )
|
|
|
|
|
|
|
|
|
|
|
|
#pragma omp critical(privateMsg)
|
|
|
|
#pragma omp critical(privateMsg)
|
|
|
|