Try improve OpenMP version of matchbox

PolySmooth
sfilippone 6 months ago
parent 41d91120d4
commit 6362db0cc5

@ -724,6 +724,7 @@ contains
& vnl, mate, iam, np,ictxt,& & vnl, mate, iam, np,ictxt,&
& msgis,msgas,msgprc,ph0t,ph1t,ph2t,ph1crd,ph2crd,info,display_inp) & msgis,msgas,msgprc,ph0t,ph1t,ph2t,ph1crd,ph2crd,info,display_inp)
if (do_timings) call psb_toc(idx_cmboxp) if (do_timings) call psb_toc(idx_cmboxp)
if (iam==0) write(0,*) iam,' buildmatching from PMatchBox:', info,ph0t,ph1t,ph2t
if (debug) write(0,*) iam,' buildmatching from PMatchBox:', info if (debug) write(0,*) iam,' buildmatching from PMatchBox:', info
if (debug_sync) then if (debug_sync) then
call psb_max(ictxt,info) call psb_max(ictxt,info)

@ -489,7 +489,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
/////////////////////////// PROCESS MESSAGES ////////////////////////////////////// /////////////////////////// PROCESS MESSAGES //////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
//startTime = MPI_Wtime();
processMessagesD(NLVer, processMessagesD(NLVer,
Mate, Mate,
candidateMate, candidateMate,

@ -30,15 +30,16 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_BD(MilanLongInt NLVer,
vector<MilanInt> &privateQOwner) vector<MilanInt> &privateQOwner)
{ {
MilanLongInt v = -1, k = -1, w = -1, adj11 = 0, adj12 = 0, k1 = 0; MilanLongInt v = -1, k = -1, w = -1, adj11 = 0, adj12 = 0, k1 = 0;
MilanInt ghostOwner = 0, option, igw; MilanInt ghostOwner = 0, option, igw;
//#pragma omp parallel private(option, k, w, v, k1, adj11, adj12, ghostOwner) \ #pragma omp parallel private(option, k, w, v, k1, adj11, adj12, ghostOwner) \
firstprivate(privateU, StartIndex, EndIndex, privateQLocalVtx, privateQGhostVtx, privateQMsgType, privateQOwner) \ firstprivate(privateU, StartIndex, EndIndex, privateQLocalVtx, \
default(shared) num_threads(NUM_THREAD) privateQGhostVtx, privateQMsgType, privateQOwner) \
default(shared) num_threads(NUM_THREAD)
{ {
//#pragma omp for reduction(+ \ #pragma omp for reduction(+ \
: PCounter[:numProcs], myCard \ : PCounter[:numProcs], myCard \
[:1], msgInd \ [:1], msgInd \
[:1], NumMessagesBundled \ [:1], NumMessagesBundled \
@ -216,17 +217,18 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_BS(MilanLongInt NLVer,
MilanLongInt v = -1, k = -1, w = -1, adj11 = 0, adj12 = 0, k1 = 0; MilanLongInt v = -1, k = -1, w = -1, adj11 = 0, adj12 = 0, k1 = 0;
MilanInt ghostOwner = 0, option, igw; MilanInt ghostOwner = 0, option, igw;
//#pragma omp parallel private(option, k, w, v, k1, adj11, adj12, ghostOwner) \ #pragma omp parallel private(option, k, w, v, k1, adj11, adj12, ghostOwner) \
firstprivate(privateU, StartIndex, EndIndex, privateQLocalVtx, privateQGhostVtx, privateQMsgType, privateQOwner) \ firstprivate(privateU, StartIndex, EndIndex, privateQLocalVtx, \
privateQGhostVtx, privateQMsgType, privateQOwner) \
default(shared) num_threads(NUM_THREAD) default(shared) num_threads(NUM_THREAD)
{ {
//#pragma omp for reduction(+ \ #pragma omp for reduction(+ \
: PCounter[:numProcs], myCard \ : PCounter[:numProcs], myCard \
[:1], msgInd \ [:1], msgInd \
[:1], NumMessagesBundled \ [:1], NumMessagesBundled \
[:1]) \ [:1]) \
schedule(static) schedule(static)
for (v = 0; v < NLVer; v++) { for (v = 0; v < NLVer; v++) {
option = -1; option = -1;
// Start: PARALLEL_PROCESS_EXPOSED_VERTEX_B(v) // Start: PARALLEL_PROCESS_EXPOSED_VERTEX_B(v)

@ -51,15 +51,16 @@ void processMatchedVerticesAndSendMessagesD(
MilanLongInt localVertices = 0; MilanLongInt localVertices = 0;
#endif #endif
//#pragma omp parallel private(k, w, v, k1, adj1, adj2, adj11, adj12, ghostOwner, option) \ //#pragma omp parallel private(k, w, v, k1, adj1, adj2, adj11, adj12, ghostOwner, option) \
firstprivate(Message, privateU, StartIndex, EndIndex, privateQLocalVtx, privateQGhostVtx,\ firstprivate(Message, privateU, StartIndex, EndIndex, privateQLocalVtx, \
privateQMsgType, privateQOwner, UChunkBeingProcessed) default(shared) \ privateQGhostVtx, privateQMsgType, privateQOwner, UChunkBeingProcessed) \
num_threads(NUM_THREAD) \ default(shared) \
reduction(+ \ num_threads(NUM_THREAD) \
: msgInd[:1], PCounter \ reduction(+ \
[:numProcs], myCard \ : msgInd[:1], PCounter \
[:1], NumMessagesBundled \ [:numProcs], myCard \
[:1], msgActual \ [:1], NumMessagesBundled \
[:1]) [:1], msgActual \
[:1])
{ {
while (!U.empty()) { while (!U.empty()) {

Loading…
Cancel
Save