Isolated under ifdef buggy matching

Poly-novrl
Cirdans-Home 11 months ago
parent 47bafd7fe7
commit 54d608d2dd

@ -72,8 +72,9 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
double tmr = MPI_Wtime(); double tmr = MPI_Wtime();
#endif #endif
#define OMP // Rimosso per tornare al vecchio matching #define OMP
#ifdef OMP #ifdef OMP
fprintf(stderr,"Warning: using buggy OpenMP matching!\n");
dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge, dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge,
verLocPtr, verLocInd, edgeLocWeight, verLocPtr, verLocInd, edgeLocWeight,
verDistance, Mate, verDistance, Mate,

@ -59,7 +59,11 @@
#include <assert.h> #include <assert.h>
#include <map> #include <map>
#include <vector> #include <vector>
#ifdef OMP
// OpenMP is included and used if and only if the OpenMP version of the matching
// is required
#include "omp.h" #include "omp.h"
#endif
#include "primitiveDataTypeDefinitions.h" #include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h" #include "dataStrStaticQueue.h"
@ -174,6 +178,10 @@ extern "C"
#define MilanRealMin MINUS_INFINITY #define MilanRealMin MINUS_INFINITY
#endif #endif
#ifdef OMP
/* These functions are only used in the experimental OMP implementation, if that
is disabled there is no reason to actually compile or reference them. */
// Function of find the owner of a ghost vertex using binary search: // Function of find the owner of a ghost vertex using binary search:
MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
MilanInt myRank, MilanInt numProcs); MilanInt myRank, MilanInt numProcs);
@ -420,6 +428,14 @@ extern "C"
MilanLongInt *msgIndSent, MilanLongInt *msgActualSent, MilanReal *msgPercent, MilanLongInt *msgIndSent, MilanLongInt *msgActualSent, MilanReal *msgPercent,
MilanReal *ph0_time, MilanReal *ph1_time, MilanReal *ph2_time, MilanReal *ph0_time, MilanReal *ph1_time, MilanReal *ph2_time,
MilanLongInt *ph1_card, MilanLongInt *ph2_card); MilanLongInt *ph1_card, MilanLongInt *ph2_card);
#endif
#ifndef OMP
//Function of find the owner of a ghost vertex using binary search:
inline MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
MilanInt myRank, MilanInt numProcs);
#endif
void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC( void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC(
MilanLongInt NLVer, MilanLongInt NLEdge, MilanLongInt NLVer, MilanLongInt NLEdge,

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
// *********************************************************************** // ***********************************************************************
// //
// MatchboxP: A C++ library for approximate weighted matching // MatchboxP: A C++ library for approximate weighted matching
@ -552,3 +552,4 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
#endif #endif
#endif #endif
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
// TODO comment // TODO comment
void clean(MilanLongInt NLVer, void clean(MilanLongInt NLVer,
@ -89,3 +89,4 @@ void clean(MilanLongInt NLVer,
} }
} }
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
/** /**
* Execute the research fr the Candidate Mate without controlling if the vertices are already matched. * Execute the research fr the Candidate Mate without controlling if the vertices are already matched.
* Returns the vertices with the highest weight * Returns the vertices with the highest weight
@ -71,3 +71,4 @@ MilanLongInt computeCandidateMate(MilanLongInt adj1,
return w; return w;
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void extractUChunk( void extractUChunk(
vector<MilanLongInt> &UChunkBeingProcessed, vector<MilanLongInt> &UChunkBeingProcessed,
vector<MilanLongInt> &U, vector<MilanLongInt> &U,
@ -29,3 +29,4 @@ void extractUChunk(
} // End of critical U // End of critical U } // End of critical U // End of critical U
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
/// Find the owner of a ghost node: /// Find the owner of a ghost node:
MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
MilanInt myRank, MilanInt numProcs) MilanInt myRank, MilanInt numProcs)
@ -27,3 +27,4 @@ MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
return Current; return Current;
} // End of findOwnerOfGhost() } // End of findOwnerOfGhost()
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void initialize(MilanLongInt NLVer, MilanLongInt NLEdge, void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt StartIndex, MilanLongInt EndIndex, MilanLongInt StartIndex, MilanLongInt EndIndex,
MilanLongInt *numGhostEdges, MilanLongInt *numGhostEdges,
@ -302,3 +302,4 @@ void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
} // End of single region } // End of single region
} // End of parallel region } // End of parallel region
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
/** /**
* //TODO documentation * //TODO documentation
* @param k * @param k
@ -44,3 +44,4 @@ bool isAlreadyMatched(MilanLongInt node,
return val >= 0; // Already matched return val >= 0; // Already matched
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
@ -25,3 +25,4 @@ void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
} }
} }
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void PROCESS_CROSS_EDGE(MilanLongInt *edge, void PROCESS_CROSS_EDGE(MilanLongInt *edge,
MilanLongInt *S) MilanLongInt *S)
{ {
@ -22,3 +22,4 @@ void PROCESS_CROSS_EDGE(MilanLongInt *edge,
// End: PARALLEL_PROCESS_CROSS_EDGE_B // End: PARALLEL_PROCESS_CROSS_EDGE_B
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer, void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
MilanLongInt *candidateMate, MilanLongInt *candidateMate,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
@ -193,3 +193,4 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
} // End of parallel region } // End of parallel region
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void processMatchedVertices( void processMatchedVertices(
MilanLongInt NLVer, MilanLongInt NLVer,
vector<MilanLongInt> &UChunkBeingProcessed, vector<MilanLongInt> &UChunkBeingProcessed,
@ -292,3 +292,4 @@ void processMatchedVertices(
#endif #endif
} // End of parallel region } // End of parallel region
} }
#endif

@ -1,4 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
//#define DEBUG_HANG_ //#define DEBUG_HANG_
void processMatchedVerticesAndSendMessages( void processMatchedVerticesAndSendMessages(
MilanLongInt NLVer, MilanLongInt NLVer,
@ -306,3 +307,4 @@ void processMatchedVerticesAndSendMessages(
cout << myRank<<" Done sending messages"<<endl; cout << myRank<<" Done sending messages"<<endl;
#endif #endif
} }
#endif

@ -1,4 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
//#define DEBUG_HANG_ //#define DEBUG_HANG_
void processMessages( void processMessages(
@ -313,3 +314,4 @@ void processMessages(
return; return;
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void queuesTransfer(vector<MilanLongInt> &U, void queuesTransfer(vector<MilanLongInt> &U,
vector<MilanLongInt> &privateU, vector<MilanLongInt> &privateU,
vector<MilanLongInt> &QLocalVtx, vector<MilanLongInt> &QLocalVtx,
@ -34,3 +34,4 @@ void queuesTransfer(vector<MilanLongInt> &U,
privateQOwner.clear(); privateQOwner.clear();
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef OMP
void sendBundledMessages(MilanLongInt *numGhostEdges, void sendBundledMessages(MilanLongInt *numGhostEdges,
MilanInt *BufferSize, MilanInt *BufferSize,
MilanLongInt *Buffer, MilanLongInt *Buffer,
@ -207,3 +207,4 @@ void sendBundledMessages(MilanLongInt *numGhostEdges,
} }
} }
} }
#endif

Loading…
Cancel
Save