Remoe MateLock

omp-walther
StefanoPetrilli 2 years ago
parent d24c8c2d46
commit cb660e044d

@ -217,7 +217,6 @@ extern "C"
MilanLongInt *S, MilanLongInt *S,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
omp_lock_t *MateLock,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap, map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
vector<MilanLongInt> &Counter, vector<MilanLongInt> &Counter,
vector<MilanLongInt> &verGhostPtr, vector<MilanLongInt> &verGhostPtr,
@ -249,8 +248,7 @@ extern "C"
MilanLongInt msgInd, MilanLongInt msgInd,
MilanLongInt *msgIndSent, MilanLongInt *msgIndSent,
MilanLongInt NumMessagesBundled, MilanLongInt NumMessagesBundled,
MilanReal *msgPercent, MilanReal *msgPercent);
omp_lock_t *MateLock);
void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
@ -322,8 +320,7 @@ extern "C"
staticQueue &privateQLocalVtx, staticQueue &privateQLocalVtx,
staticQueue &privateQGhostVtx, staticQueue &privateQGhostVtx,
staticQueue &privateQMsgType, staticQueue &privateQMsgType,
staticQueue &privateQOwner, staticQueue &privateQOwner);
omp_lock_t *MateLock);
void sendBundledMessages(MilanLongInt *numGhostEdgesPtr, void sendBundledMessages(MilanLongInt *numGhostEdgesPtr,
MilanInt *BufferSizePtr, MilanInt *BufferSizePtr,

@ -190,14 +190,10 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
MilanInt BufferSize; MilanInt BufferSize;
MilanLongInt *Buffer; MilanLongInt *Buffer;
// Declare the locks
omp_lock_t MateLock[NLVer];
initialize(NLVer, NLEdge, StartIndex, initialize(NLVer, NLEdge, StartIndex,
EndIndex, &numGhostEdges, EndIndex, &numGhostEdges,
&numGhostVertices, &S, &numGhostVertices, &S,
verLocInd, verLocPtr, verLocInd, verLocPtr,
MateLock,
Ghost2LocalMap, Counter, Ghost2LocalMap, Counter,
verGhostPtr, verGhostInd, verGhostPtr, verGhostInd,
tempCounter, GMate, tempCounter, GMate,
@ -307,8 +303,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
privateQLocalVtx, privateQLocalVtx,
privateQGhostVtx, privateQGhostVtx,
privateQMsgType, privateQMsgType,
privateQOwner, privateQOwner);
MateLock);
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////// SEND BUNDLED MESSAGES ///////////////////////////////////// ///////////////////////////// SEND BUNDLED MESSAGES /////////////////////////////////////
@ -616,8 +611,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
msgInd, msgInd,
msgIndSent, msgIndSent,
NumMessagesBundled, NumMessagesBundled,
msgPercent, msgPercent);
MateLock);
finishTime = MPI_Wtime(); finishTime = MPI_Wtime();
*ph2_time = finishTime - startTime; // Time taken for Phase-2 *ph2_time = finishTime - startTime; // Time taken for Phase-2

@ -16,8 +16,7 @@ void clean(MilanLongInt NLVer,
MilanLongInt msgInd, MilanLongInt msgInd,
MilanLongInt *msgIndSent, MilanLongInt *msgIndSent,
MilanLongInt NumMessagesBundled, MilanLongInt NumMessagesBundled,
MilanReal *msgPercent, MilanReal *msgPercent)
omp_lock_t *MateLock)
{ {
// Cleanup Phase // Cleanup Phase
@ -83,10 +82,6 @@ void clean(MilanLongInt NLVer,
*msgPercent = 0; *msgPercent = 0;
} }
} }
// Destroy the locks
#pragma omp taskloop num_tasks(NUM_THREAD)
for (int i = 0; i < NLVer; i++)
omp_destroy_lock(&MateLock[i]);
#ifdef DEBUG_HANG_ #ifdef DEBUG_HANG_
if (myRank == 0) if (myRank == 0)

@ -7,7 +7,6 @@ void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt *S, MilanLongInt *S,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
omp_lock_t *MateLock,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap, map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
vector<MilanLongInt> &Counter, vector<MilanLongInt> &Counter,
vector<MilanLongInt> &verGhostPtr, vector<MilanLongInt> &verGhostPtr,
@ -40,10 +39,6 @@ void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
#pragma omp single #pragma omp single
{ {
// Initialize the locks
#pragma omp taskloop num_tasks(NUM_THREAD)
for (i = 0; i < NLVer; i++)
omp_init_lock(&MateLock[i]);
#ifdef TIME_TRACKER #ifdef TIME_TRACKER
double Ghost2LocalInitialization = MPI_Wtime(); double Ghost2LocalInitialization = MPI_Wtime();

@ -10,6 +10,8 @@ void PROCESS_CROSS_EDGE(vector<MilanLongInt> &Counter,
#pragma omp atomic capture #pragma omp atomic capture
captureCounter = --Counter[edge]; // Decrement captureCounter = --Counter[edge]; // Decrement
//assert(captureCounter >= 0);
if (captureCounter == 0) if (captureCounter == 0)
#pragma omp atomic #pragma omp atomic
(*SPtr)--; // Decrement S (*SPtr)--; // Decrement S

@ -31,8 +31,7 @@ void processMatchedVertices(
staticQueue &privateQLocalVtx, staticQueue &privateQLocalVtx,
staticQueue &privateQGhostVtx, staticQueue &privateQGhostVtx,
staticQueue &privateQMsgType, staticQueue &privateQMsgType,
staticQueue &privateQOwner, staticQueue &privateQOwner)
omp_lock_t *MateLock)
{ {
MilanLongInt adj1, adj2, adj11, adj12, k, k1, v = -1, w = -1, ghostOwner; MilanLongInt adj1, adj2, adj11, adj12, k, k1, v = -1, w = -1, ghostOwner;

Loading…
Cancel
Save