|
|
@ -30,7 +30,7 @@ void processMessages(
|
|
|
|
|
|
|
|
|
|
|
|
MilanInt Sender;
|
|
|
|
MilanInt Sender;
|
|
|
|
MPI_Status computeStatus;
|
|
|
|
MPI_Status computeStatus;
|
|
|
|
MilanLongInt bundleSize, bundleCounter = 0, myCard = *myCardPtr, msgInd = *msgIndPtr, msgActual = *msgActualPtr, w;
|
|
|
|
MilanLongInt bundleSize, myCard = *myCardPtr, msgInd = *msgIndPtr, msgActual = *msgActualPtr, w;
|
|
|
|
MilanLongInt adj11, adj12, k1;
|
|
|
|
MilanLongInt adj11, adj12, k1;
|
|
|
|
MilanLongInt ghostOwner;
|
|
|
|
MilanLongInt ghostOwner;
|
|
|
|
int error_codeC;
|
|
|
|
int error_codeC;
|
|
|
@ -155,15 +155,13 @@ void processMessages(
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stdout);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
bundleCounter = 0;
|
|
|
|
|
|
|
|
while (bundleCounter < bundleSize)
|
|
|
|
//Most of the time bundleSize == 3, thus, it's not worth parallelizing thi loop
|
|
|
|
|
|
|
|
for (MilanLongInt bundleCounter = 3; bundleCounter < bundleSize + 3; bundleCounter += 3)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
u = ReceiveBuffer[bundleCounter]; // GHOST
|
|
|
|
u = ReceiveBuffer[bundleCounter - 3]; // GHOST
|
|
|
|
bundleCounter++;
|
|
|
|
v = ReceiveBuffer[bundleCounter - 2]; // LOCAL
|
|
|
|
v = ReceiveBuffer[bundleCounter]; // LOCAL
|
|
|
|
message_type = ReceiveBuffer[bundleCounter - 1]; // TYPE
|
|
|
|
bundleCounter++;
|
|
|
|
|
|
|
|
message_type = ReceiveBuffer[bundleCounter]; // TYPE
|
|
|
|
|
|
|
|
bundleCounter++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CASE I: REQUEST
|
|
|
|
// CASE I: REQUEST
|
|
|
|
if (message_type == REQUEST)
|
|
|
|
if (message_type == REQUEST)
|
|
|
@ -188,7 +186,6 @@ void processMessages(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GMate[Ghost2LocalMap[u]] = v; // u is ghost
|
|
|
|
GMate[Ghost2LocalMap[u]] = v; // u is ghost
|
|
|
|
Mate[v - StartIndex] = u; // v is local
|
|
|
|
Mate[v - StartIndex] = u; // v is local
|
|
|
|
// Q.push_back(u);
|
|
|
|
|
|
|
|
U.push_back(v);
|
|
|
|
U.push_back(v);
|
|
|
|
U.push_back(u);
|
|
|
|
U.push_back(u);
|
|
|
|
myCard++;
|
|
|
|
myCard++;
|
|
|
@ -196,7 +193,8 @@ void processMessages(
|
|
|
|
cout << "\n(" << myRank << ")MATCH: (" << v << "," << u << ") " << endl;
|
|
|
|
cout << "\n(" << myRank << ")MATCH: (" << v << "," << u << ") " << endl;
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stdout);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap, u, S);
|
|
|
|
|
|
|
|
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap[u], S);
|
|
|
|
} // End of if ( candidateMate[v-StartIndex] == u )e
|
|
|
|
} // End of if ( candidateMate[v-StartIndex] == u )e
|
|
|
|
} // End of if ( Mate[v] == -1 )
|
|
|
|
} // End of if ( Mate[v] == -1 )
|
|
|
|
} // End of REQUEST
|
|
|
|
} // End of REQUEST
|
|
|
@ -208,8 +206,8 @@ void processMessages(
|
|
|
|
cout << "\n(" << myRank << ")Message type is SUCCESS" << endl;
|
|
|
|
cout << "\n(" << myRank << ")Message type is SUCCESS" << endl;
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stdout);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
GMate[Ghost2LocalMap[u]] = EndIndex + 1; // Set a Dummy Mate to make sure that we do not (u is a ghost)
|
|
|
|
GMate[Ghost2LocalMap[u]] = EndIndex + 1; // Set a Dummy Mate to make sure that we do not (u is a ghost) process it again
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap, u, S);
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap[u], S);
|
|
|
|
#ifdef DEBUG_GHOST_
|
|
|
|
#ifdef DEBUG_GHOST_
|
|
|
|
if ((v < 0) || (v < StartIndex) || ((v - StartIndex) > NLVer))
|
|
|
|
if ((v < 0) || (v < StartIndex) || ((v - StartIndex) > NLVer))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -261,8 +259,8 @@ void processMessages(
|
|
|
|
cout << "\n(" << myRank << ")MATCH: (" << v << "," << w << ") " << endl;
|
|
|
|
cout << "\n(" << myRank << ")MATCH: (" << v << "," << w << ") " << endl;
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stdout);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// Decrement the counter:
|
|
|
|
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap, w, S);
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap[w], S);
|
|
|
|
} // End of if CandidateMate[w] = v
|
|
|
|
} // End of if CandidateMate[w] = v
|
|
|
|
} // End of if a Ghost Vertex
|
|
|
|
} // End of if a Ghost Vertex
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -321,7 +319,7 @@ void processMessages(
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stdout);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
GMate[Ghost2LocalMap[u]] = EndIndex + 1; // Set a Dummy Mate to make sure that we do not (u is a ghost) process this anymore
|
|
|
|
GMate[Ghost2LocalMap[u]] = EndIndex + 1; // Set a Dummy Mate to make sure that we do not (u is a ghost) process this anymore
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap, u, S); // Decrease the counter
|
|
|
|
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap[u], S); // Decrease the counter
|
|
|
|
} // End of else: CASE III
|
|
|
|
} // End of else: CASE III
|
|
|
|
} // End of else: CASE I
|
|
|
|
} // End of else: CASE I
|
|
|
|
}
|
|
|
|
}
|
|
|
|