PROCESS_CROSS_EDGE refactoring

omp-walther
StefanoPetrilli 2 years ago
parent 4f07a70ed1
commit a71fe82752

@ -287,8 +287,7 @@ extern "C"
staticQueue &privateQMsgType, staticQueue &privateQMsgType,
staticQueue &privateQOwner); staticQueue &privateQOwner);
void PROCESS_CROSS_EDGE(vector<MilanLongInt> &Counter, void PROCESS_CROSS_EDGE(MilanLongInt *edge,
MilanLongInt edge,
MilanLongInt *SPtr); MilanLongInt *SPtr);
void processMatchedVertices( void processMatchedVertices(

@ -456,7 +456,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
fflush(stdout); fflush(stdout);
#endif #endif
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

@ -1,14 +1,13 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
void PROCESS_CROSS_EDGE(vector<MilanLongInt> &Counter, void PROCESS_CROSS_EDGE(MilanLongInt *edge,
MilanLongInt edge,
MilanLongInt *SPtr) MilanLongInt *SPtr)
{ {
// Start: PARALLEL_PROCESS_CROSS_EDGE_B // Start: PARALLEL_PROCESS_CROSS_EDGE_B
MilanLongInt captureCounter; MilanLongInt captureCounter;
#pragma omp atomic capture #pragma omp atomic capture
captureCounter = --Counter[edge]; // Decrement captureCounter = --(*edge); // Decrement
//assert(captureCounter >= 0); //assert(captureCounter >= 0);

@ -115,7 +115,7 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
//TODO refactor this!! //TODO refactor this!!
// Decrement the counter: // 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

@ -183,7 +183,7 @@ void processMatchedVertices(
fflush(stdout); fflush(stdout);
#endif #endif
// Decrement the counter: // Decrement the counter:
PROCESS_CROSS_EDGE(Counter, Ghost2LocalMap[w], SPtr); PROCESS_CROSS_EDGE(&Counter[Ghost2LocalMap[w]], SPtr);
case 2: case 2:
// 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);

@ -194,7 +194,7 @@ void processMessages(
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
@ -207,7 +207,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 it again 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))
{ {
@ -260,7 +260,7 @@ void processMessages(
fflush(stdout); fflush(stdout);
#endif #endif
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
@ -319,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
} }

Loading…
Cancel
Save