|
|
@ -7,9 +7,9 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
staticQueue &privateU,
|
|
|
|
staticQueue &privateU,
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
MilanLongInt *myCardPtr,
|
|
|
|
MilanLongInt *myCard,
|
|
|
|
MilanLongInt *msgIndPtr,
|
|
|
|
MilanLongInt *msgInd,
|
|
|
|
MilanLongInt *NumMessagesBundledPtr,
|
|
|
|
MilanLongInt *NumMessagesBundled,
|
|
|
|
MilanLongInt *SPtr,
|
|
|
|
MilanLongInt *SPtr,
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
@ -34,7 +34,6 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
bool sendMessages,
|
|
|
|
bool sendMessages,
|
|
|
|
MPI_Comm comm,
|
|
|
|
MPI_Comm comm,
|
|
|
|
MilanLongInt *msgActual,
|
|
|
|
MilanLongInt *msgActual,
|
|
|
|
MilanLongInt *msgInd,
|
|
|
|
|
|
|
|
vector<MilanLongInt> &Message)
|
|
|
|
vector<MilanLongInt> &Message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -53,7 +52,16 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
#ifdef COUNT_LOCAL_VERTEX
|
|
|
|
#ifdef COUNT_LOCAL_VERTEX
|
|
|
|
MilanLongInt localVertices = 0;
|
|
|
|
MilanLongInt localVertices = 0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#pragma omp parallel private(k, w, v, k1, adj1, adj2, adj11, adj12, ghostOwner, option) firstprivate(Message, privateU, StartIndex, EndIndex, privateQLocalVtx, privateQGhostVtx, privateQMsgType, privateQOwner, UChunkBeingProcessed) default(shared) num_threads(NUM_THREAD)
|
|
|
|
#pragma omp parallel private(k, w, v, k1, adj1, adj2, adj11, adj12, ghostOwner, option) \
|
|
|
|
|
|
|
|
firstprivate(Message, privateU, StartIndex, EndIndex, privateQLocalVtx, privateQGhostVtx, privateQMsgType, privateQOwner, UChunkBeingProcessed) \
|
|
|
|
|
|
|
|
default(shared) \
|
|
|
|
|
|
|
|
num_threads(NUM_THREAD) \
|
|
|
|
|
|
|
|
reduction(+ \
|
|
|
|
|
|
|
|
: msgInd[:1], PCounter \
|
|
|
|
|
|
|
|
[:numProcs], myCard \
|
|
|
|
|
|
|
|
[:1], NumMessagesBundled \
|
|
|
|
|
|
|
|
[:1], msgActual \
|
|
|
|
|
|
|
|
[:1])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
while (!U.empty())
|
|
|
|
while (!U.empty())
|
|
|
@ -178,8 +186,7 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
// Found a dominating edge, it is a ghost and candidateMate[NLVer + Ghost2LocalMap[w]] == v
|
|
|
|
// Found a dominating edge, it is a ghost and candidateMate[NLVer + Ghost2LocalMap[w]] == v
|
|
|
|
privateU.push_back(v);
|
|
|
|
privateU.push_back(v);
|
|
|
|
privateU.push_back(w);
|
|
|
|
privateU.push_back(w);
|
|
|
|
#pragma omp atomic
|
|
|
|
(*myCard)++;
|
|
|
|
(*myCardPtr)++;
|
|
|
|
|
|
|
|
#ifdef PRINT_DEBUG_INFO_
|
|
|
|
#ifdef PRINT_DEBUG_INFO_
|
|
|
|
cout << "\n(" << myRank << ")MATCH: (" << v << "," << w << ") ";
|
|
|
|
cout << "\n(" << myRank << ")MATCH: (" << v << "," << w << ") ";
|
|
|
|
fflush(stdout);
|
|
|
|
fflush(stdout);
|
|
|
@ -190,8 +197,8 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
|
|
|
|
|
|
|
|
// Found a dominating edge, it is a ghost
|
|
|
|
// Found a dominating edge, it is a ghost
|
|
|
|
ghostOwner = findOwnerOfGhost(w, verDistance, myRank, numProcs);
|
|
|
|
ghostOwner = findOwnerOfGhost(w, verDistance, myRank, numProcs);
|
|
|
|
assert(ghostOwner != -1);
|
|
|
|
// assert(ghostOwner != -1);
|
|
|
|
assert(ghostOwner != myRank);
|
|
|
|
// assert(ghostOwner != myRank);
|
|
|
|
if (sendMessages)
|
|
|
|
if (sendMessages)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Build the Message Packet:
|
|
|
|
// Build the Message Packet:
|
|
|
@ -211,19 +218,15 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
|
|
|
|
// MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
|
|
|
|
|
|
|
|
|
|
|
|
#pragma omp atomic
|
|
|
|
|
|
|
|
(*msgActual)++;
|
|
|
|
(*msgActual)++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#pragma omp atomic
|
|
|
|
|
|
|
|
PCounter[ghostOwner]++;
|
|
|
|
PCounter[ghostOwner]++;
|
|
|
|
#pragma omp atomic
|
|
|
|
(*NumMessagesBundled)++;
|
|
|
|
(*NumMessagesBundledPtr)++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma omp atomic
|
|
|
|
(*msgInd)++;
|
|
|
|
(*msgIndPtr)++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
privateQLocalVtx.push_back(v);
|
|
|
|
privateQLocalVtx.push_back(v);
|
|
|
|
privateQGhostVtx.push_back(w);
|
|
|
|
privateQGhostVtx.push_back(w);
|
|
|
@ -233,8 +236,7 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
privateU.push_back(v);
|
|
|
|
privateU.push_back(v);
|
|
|
|
privateU.push_back(w);
|
|
|
|
privateU.push_back(w);
|
|
|
|
#pragma omp atomic
|
|
|
|
(*myCard)++;
|
|
|
|
(*myCardPtr)++;
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 4:
|
|
|
|
// Could not find a dominating vertex
|
|
|
|
// Could not find a dominating vertex
|
|
|
@ -253,8 +255,8 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
ghostOwner = findOwnerOfGhost(w, verDistance, myRank, numProcs);
|
|
|
|
ghostOwner = findOwnerOfGhost(w, verDistance, myRank, numProcs);
|
|
|
|
assert(ghostOwner != -1);
|
|
|
|
// assert(ghostOwner != -1);
|
|
|
|
assert(ghostOwner != myRank);
|
|
|
|
// assert(ghostOwner != myRank);
|
|
|
|
if (sendMessages)
|
|
|
|
if (sendMessages)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Build the Message Packet:
|
|
|
|
// Build the Message Packet:
|
|
|
@ -273,19 +275,15 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
messagesToSend.push_back(ghostOwner);
|
|
|
|
messagesToSend.push_back(ghostOwner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
|
|
|
|
// MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
|
|
|
|
#pragma omp atomic
|
|
|
|
|
|
|
|
(*msgActual)++;
|
|
|
|
(*msgActual)++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#pragma omp atomic
|
|
|
|
|
|
|
|
PCounter[ghostOwner]++;
|
|
|
|
PCounter[ghostOwner]++;
|
|
|
|
#pragma omp atomic
|
|
|
|
(*NumMessagesBundled)++;
|
|
|
|
(*NumMessagesBundledPtr)++;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma omp atomic
|
|
|
|
(*msgInd)++;
|
|
|
|
(*msgIndPtr)++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
privateQLocalVtx.push_back(v);
|
|
|
|
privateQLocalVtx.push_back(v);
|
|
|
|
privateQGhostVtx.push_back(w);
|
|
|
|
privateQGhostVtx.push_back(w);
|
|
|
@ -305,8 +303,8 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
ghostOwner = findOwnerOfGhost(v, verDistance, myRank, numProcs);
|
|
|
|
ghostOwner = findOwnerOfGhost(v, verDistance, myRank, numProcs);
|
|
|
|
assert(ghostOwner != -1);
|
|
|
|
// assert(ghostOwner != -1);
|
|
|
|
assert(ghostOwner != myRank);
|
|
|
|
// assert(ghostOwner != myRank);
|
|
|
|
if (sendMessages)
|
|
|
|
if (sendMessages)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Build the Message Packet:
|
|
|
|
// Build the Message Packet:
|
|
|
@ -325,19 +323,15 @@ void processMatchedVerticesAndSendMessages(
|
|
|
|
messagesToSend.push_back(ghostOwner);
|
|
|
|
messagesToSend.push_back(ghostOwner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
|
|
|
|
// MPI_Bsend(&Message[0], 3, TypeMap<MilanLongInt>(), ghostOwner, ComputeTag, comm);
|
|
|
|
#pragma omp atomic
|
|
|
|
|
|
|
|
(*msgActual)++;
|
|
|
|
(*msgActual)++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#pragma omp atomic
|
|
|
|
(*NumMessagesBundled)++;
|
|
|
|
(*NumMessagesBundledPtr)++;
|
|
|
|
|
|
|
|
#pragma omp atomic
|
|
|
|
|
|
|
|
PCounter[ghostOwner]++;
|
|
|
|
PCounter[ghostOwner]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma omp atomic
|
|
|
|
(*msgInd)++;
|
|
|
|
(*msgIndPtr)++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
privateQLocalVtx.push_back(u);
|
|
|
|
privateQLocalVtx.push_back(u);
|
|
|
|
privateQGhostVtx.push_back(v);
|
|
|
|
privateQGhostVtx.push_back(v);
|
|
|
|