diff --git a/amgprec/impl/aggregator/MatchBoxPC.h b/amgprec/impl/aggregator/MatchBoxPC.h index 6c3f765f..94ea7ea8 100644 --- a/amgprec/impl/aggregator/MatchBoxPC.h +++ b/amgprec/impl/aggregator/MatchBoxPC.h @@ -152,6 +152,11 @@ extern "C" { inline MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt myRank, MilanInt numProcs); +inline MilanLongInt firstComputeCandidateMate(MilanLongInt adj1, + MilanLongInt adj2, + MilanLongInt* verLocInd, + MilanReal* edgeLocWeight); + void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP ( MilanLongInt NLVer, MilanLongInt NLEdge, diff --git a/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp b/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp index 4814d32e..84d05e08 100644 --- a/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp +++ b/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp @@ -455,9 +455,9 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP( ((edgeLocWeight[k] == heaviestEdgeWt) && (w < verLocInd[k]))) { heaviestEdgeWt = edgeLocWeight[k]; w = verLocInd[k]; - } } //End of for loop + //printf("Compare %ld, %ld\n", w, firstComputeCandidateMate(verLocPtr[v], verLocPtr[v + 1], verLocInd, edgeLocWeight)); candidateMate[v] = w; //End: PARALLEL_COMPUTE_CANDIDATE_MATE_B(v) @@ -594,8 +594,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP( /////////////////////////////////////////////////////////////////////////////////// /////////////////////////// PROCESS MATCHED VERTICES ////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// - while ( /*!Q.empty()*/ !U.empty() ) { - //Q.pop_front(); + while ( !U.empty() ) { u = U.pop_front(); //Get an element from the queue #ifdef PRINT_DEBUG_INFO_ cout<<"\n("< heaviestEdgeWt) || + ((edgeLocWeight[k] == heaviestEdgeWt) && (w < verLocInd[k]))) { + heaviestEdgeWt = edgeLocWeight[k]; + w = verLocInd[k]; + } + } //End of for loop + return w; +} + +/* +inline MilanLongInt firstComputeCandidateMate(MilanLongInt adj1, + MilanLongInt adj2, + MilanLongInt* verLocInd, + MilanReal* edgeLocWeight) +{ + MilanInt w = -1; + MilanReal heaviestEdgeWt = MilanRealMin; //Assign the smallest Value possible first LDBL_MIN + for (k = adj1; k < adj2; k++) { + if ((verLocInd[k] < StartIndex) || (verLocInd[k] > EndIndex)) { //Is it a ghost vertex? + if (GMate[Ghost2LocalMap[verLocInd[k]]] >= 0)// Already matched + continue; + } else { //A local vertex + if (Mate[verLocInd[k] - StartIndex] >= 0) // Already matched + continue; + } + + if ((edgeLocWeight[k] > heaviestEdgeWt) || + ((edgeLocWeight[k] == heaviestEdgeWt) && (w < verLocInd[k]))) { + heaviestEdgeWt = edgeLocWeight[k]; + w = verLocInd[k]; + } + } //End of for loop + return w; +} + */ #endif #endif \ No newline at end of file diff --git a/samples/advanced/pdegen/runs/amg_pde3d.inp b/samples/advanced/pdegen/runs/amg_pde3d.inp index eb254780..bdacc992 100644 --- a/samples/advanced/pdegen/runs/amg_pde3d.inp +++ b/samples/advanced/pdegen/runs/amg_pde3d.inp @@ -1,6 +1,6 @@ %%%%%%%%%%% General arguments % Lines starting with % are ignored. CSR ! Storage format CSR COO JAD -0080 ! IDIM; domain size. Linear system size is IDIM**3 +0123 ! IDIM; domain size. Linear system size is IDIM**3 CONST ! PDECOEFF: CONST, EXP, GAUSS Coefficients of the PDE BICGSTAB ! Iterative method: BiCGSTAB BiCGSTABL BiCG CG CGS FCG GCR RGMRES 2 ! ISTOPC