From fb802c62cd51624ee16130cf8d7c42b76a8c7c95 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 30 May 2024 17:25:25 +0200 Subject: [PATCH 1/3] Merge PSBCXXDEFINES into AMGCXXDEFINES --- Make.inc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Make.inc.in b/Make.inc.in index 3638f486..9ac10ee7 100644 --- a/Make.inc.in +++ b/Make.inc.in @@ -75,7 +75,7 @@ CDEFINES=$(AMGCDEFINES) AMGFDEFINES=@AMGFDEFINES@ $(PSBFDEFINES) FDEFINES=$(AMGFDEFINES) -CXXDEFINES=@AMGCXXDEFINES@ +CXXDEFINES=@AMGCXXDEFINES@ $(PSBCXXDEFINES) @COMPILERULES@ From 13eee99ea33edb44c1ddcb2ce47932864547a5b5 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 30 May 2024 17:26:34 +0200 Subject: [PATCH 2/3] Use ifdef OPENMP --- amgprec/impl/aggregator/MatchBoxPC.cpp | 2 +- amgprec/impl/aggregator/MatchBoxPC.h | 6 +++--- ...stEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp | 2 +- amgprec/impl/aggregator/clean.cpp | 2 +- amgprec/impl/aggregator/computeCandidateMate.cpp | 2 +- amgprec/impl/aggregator/extractUChunk.cpp | 2 +- amgprec/impl/aggregator/findOwnerOfGhost.cpp | 2 +- amgprec/impl/aggregator/initialize.cpp | 2 +- amgprec/impl/aggregator/isAlreadyMatched.cpp | 2 +- amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp | 2 +- amgprec/impl/aggregator/processCrossEdge.cpp | 2 +- amgprec/impl/aggregator/processExposedVertex.cpp | 2 +- .../aggregator/processMatchedVerticesAndSendMessages.cpp | 2 +- amgprec/impl/aggregator/processMessages.cpp | 2 +- amgprec/impl/aggregator/queueTransfer.cpp | 2 +- amgprec/impl/aggregator/sendBundledMessages.cpp | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/amgprec/impl/aggregator/MatchBoxPC.cpp b/amgprec/impl/aggregator/MatchBoxPC.cpp index 37a879be..146e8aa1 100644 --- a/amgprec/impl/aggregator/MatchBoxPC.cpp +++ b/amgprec/impl/aggregator/MatchBoxPC.cpp @@ -73,7 +73,7 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge, #endif // Rimosso per tornare al vecchio matching #define OMP -#ifdef OMP +#ifdef OPENMP fprintf(stderr,"Warning: using buggy OpenMP matching!\n"); dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge, verLocPtr, verLocInd, edgeLocWeight, diff --git a/amgprec/impl/aggregator/MatchBoxPC.h b/amgprec/impl/aggregator/MatchBoxPC.h index 35cab21d..24fd3134 100644 --- a/amgprec/impl/aggregator/MatchBoxPC.h +++ b/amgprec/impl/aggregator/MatchBoxPC.h @@ -59,7 +59,7 @@ #include #include #include -#ifdef OMP +#ifdef OPENMP // OpenMP is included and used if and only if the OpenMP version of the matching // is required #include "omp.h" @@ -178,7 +178,7 @@ extern "C" #define MilanRealMin MINUS_INFINITY #endif -#ifdef OMP +#ifdef OPENMP /* These functions are only used in the experimental OMP implementation, if that is disabled there is no reason to actually compile or reference them. */ @@ -431,7 +431,7 @@ is disabled there is no reason to actually compile or reference them. */ #endif -#ifndef OMP +#ifndef OPENMP //Function of find the owner of a ghost vertex using binary search: inline MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt myRank, MilanInt numProcs); diff --git a/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp b/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp index b086edad..7e332cef 100644 --- a/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp +++ b/amgprec/impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP // *********************************************************************** // // MatchboxP: A C++ library for approximate weighted matching diff --git a/amgprec/impl/aggregator/clean.cpp b/amgprec/impl/aggregator/clean.cpp index 018469e4..479dcce3 100644 --- a/amgprec/impl/aggregator/clean.cpp +++ b/amgprec/impl/aggregator/clean.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP // TODO comment void clean(MilanLongInt NLVer, diff --git a/amgprec/impl/aggregator/computeCandidateMate.cpp b/amgprec/impl/aggregator/computeCandidateMate.cpp index 39ce8db1..f70b8866 100644 --- a/amgprec/impl/aggregator/computeCandidateMate.cpp +++ b/amgprec/impl/aggregator/computeCandidateMate.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP /** * Execute the research fr the Candidate Mate without controlling if the vertices are already matched. * Returns the vertices with the highest weight diff --git a/amgprec/impl/aggregator/extractUChunk.cpp b/amgprec/impl/aggregator/extractUChunk.cpp index 0986dfb6..4e50a4f3 100644 --- a/amgprec/impl/aggregator/extractUChunk.cpp +++ b/amgprec/impl/aggregator/extractUChunk.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void extractUChunk( vector &UChunkBeingProcessed, vector &U, diff --git a/amgprec/impl/aggregator/findOwnerOfGhost.cpp b/amgprec/impl/aggregator/findOwnerOfGhost.cpp index 81c18822..2723a7a3 100644 --- a/amgprec/impl/aggregator/findOwnerOfGhost.cpp +++ b/amgprec/impl/aggregator/findOwnerOfGhost.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP /// Find the owner of a ghost node: MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt myRank, MilanInt numProcs) diff --git a/amgprec/impl/aggregator/initialize.cpp b/amgprec/impl/aggregator/initialize.cpp index 3f0f1a10..2c8f052d 100644 --- a/amgprec/impl/aggregator/initialize.cpp +++ b/amgprec/impl/aggregator/initialize.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void initialize(MilanLongInt NLVer, MilanLongInt NLEdge, MilanLongInt StartIndex, MilanLongInt EndIndex, MilanLongInt *numGhostEdges, diff --git a/amgprec/impl/aggregator/isAlreadyMatched.cpp b/amgprec/impl/aggregator/isAlreadyMatched.cpp index de5f2f18..16d47a14 100644 --- a/amgprec/impl/aggregator/isAlreadyMatched.cpp +++ b/amgprec/impl/aggregator/isAlreadyMatched.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP /** * //TODO documentation * @param k diff --git a/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp b/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp index f5429bf4..79f253eb 100644 --- a/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp +++ b/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, MilanLongInt *verLocPtr, MilanLongInt *verLocInd, diff --git a/amgprec/impl/aggregator/processCrossEdge.cpp b/amgprec/impl/aggregator/processCrossEdge.cpp index d7c72d42..45cddb44 100644 --- a/amgprec/impl/aggregator/processCrossEdge.cpp +++ b/amgprec/impl/aggregator/processCrossEdge.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void PROCESS_CROSS_EDGE(MilanLongInt *edge, MilanLongInt *S) { diff --git a/amgprec/impl/aggregator/processExposedVertex.cpp b/amgprec/impl/aggregator/processExposedVertex.cpp index c7ac4703..ba07425a 100644 --- a/amgprec/impl/aggregator/processExposedVertex.cpp +++ b/amgprec/impl/aggregator/processExposedVertex.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer, MilanLongInt *candidateMate, MilanLongInt *verLocInd, diff --git a/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp b/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp index 4a9cfcba..e02dd9c7 100644 --- a/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp +++ b/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP //#define DEBUG_HANG_ void processMatchedVerticesAndSendMessages( MilanLongInt NLVer, diff --git a/amgprec/impl/aggregator/processMessages.cpp b/amgprec/impl/aggregator/processMessages.cpp index 6ac3f541..dc09cde1 100644 --- a/amgprec/impl/aggregator/processMessages.cpp +++ b/amgprec/impl/aggregator/processMessages.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP //#define DEBUG_HANG_ void processMessages( diff --git a/amgprec/impl/aggregator/queueTransfer.cpp b/amgprec/impl/aggregator/queueTransfer.cpp index e51095da..51989f34 100644 --- a/amgprec/impl/aggregator/queueTransfer.cpp +++ b/amgprec/impl/aggregator/queueTransfer.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void queuesTransfer(vector &U, vector &privateU, vector &QLocalVtx, diff --git a/amgprec/impl/aggregator/sendBundledMessages.cpp b/amgprec/impl/aggregator/sendBundledMessages.cpp index 919dc7e9..3349ce86 100644 --- a/amgprec/impl/aggregator/sendBundledMessages.cpp +++ b/amgprec/impl/aggregator/sendBundledMessages.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void sendBundledMessages(MilanLongInt *numGhostEdges, MilanInt *BufferSize, MilanLongInt *Buffer, From 67594f8b07c5d7547af166c5040f779fc8b37b1c Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 30 May 2024 17:35:15 +0200 Subject: [PATCH 3/3] Fixes for OpenMP --- amgprec/impl/aggregator/MatchBoxPC.cpp | 2 +- amgprec/impl/aggregator/processMatchedVertices.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amgprec/impl/aggregator/MatchBoxPC.cpp b/amgprec/impl/aggregator/MatchBoxPC.cpp index 146e8aa1..a43fb2f5 100644 --- a/amgprec/impl/aggregator/MatchBoxPC.cpp +++ b/amgprec/impl/aggregator/MatchBoxPC.cpp @@ -74,7 +74,7 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge, // Rimosso per tornare al vecchio matching #define OMP #ifdef OPENMP - fprintf(stderr,"Warning: using buggy OpenMP matching!\n"); + //fprintf(stderr,"Warning: using buggy OpenMP matching!\n"); dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge, verLocPtr, verLocInd, edgeLocWeight, verDistance, Mate, diff --git a/amgprec/impl/aggregator/processMatchedVertices.cpp b/amgprec/impl/aggregator/processMatchedVertices.cpp index d88199a6..77ec34bb 100644 --- a/amgprec/impl/aggregator/processMatchedVertices.cpp +++ b/amgprec/impl/aggregator/processMatchedVertices.cpp @@ -1,5 +1,5 @@ #include "MatchBoxPC.h" -#ifdef OMP +#ifdef OPENMP void processMatchedVertices( MilanLongInt NLVer, vector &UChunkBeingProcessed,