Makefile fix

omp-walther
StefanoPetrilli 4 years ago
parent 32777cc15c
commit 36bd3a51a2

@ -62,9 +62,22 @@ amg_s_parmatch_smth_bld.o \
amg_s_parmatch_spmm_bld_inner.o amg_s_parmatch_spmm_bld_inner.o
MPCOBJS=MatchBoxPC.o \ MPCOBJS=MatchBoxPC.o \
sendBundledMessages.o \
initialize.o \
extractUChunk.o \
isAlreadyMatched.o \
findOwnerOfGhost.o \
computeCandidateMate.o \
parallelComputeCandidateMateB.o \
processMatchedVertices.o \
processCrossEdge.o \
queueTransfer.o \
processMessages.o \
processExposedVertex.o \
algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC.o \ algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC.o \
algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.o algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.o
OBJS = $(FOBJS) $(MPCOBJS) OBJS = $(FOBJS) $(MPCOBJS)
LIBNAME=libamg_prec.a LIBNAME=libamg_prec.a

@ -64,7 +64,10 @@
#include "dataStrStaticQueue.h" #include "dataStrStaticQueue.h"
using namespace std; using namespace std;
#define NUM_THREAD 4 #define NUM_THREAD 4
#define UCHUNK 1000
const MilanLongInt REQUEST = 1; const MilanLongInt REQUEST = 1;
const MilanLongInt SUCCESS = 2; const MilanLongInt SUCCESS = 2;
const MilanLongInt FAILURE = 3; const MilanLongInt FAILURE = 3;
@ -166,25 +169,34 @@ extern "C"
#define MilanRealMin MINUS_INFINITY #define MilanRealMin MINUS_INFINITY
#endif #endif
// Function of find the owner of a ghost vertex using binary search: // Function of find the owner of a ghost vertex using binary search:
inline MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
MilanInt myRank, MilanInt numProcs); MilanInt myRank, MilanInt numProcs);
inline MilanLongInt firstComputeCandidateMate(MilanLongInt adj1, MilanLongInt firstComputeCandidateMate(MilanLongInt adj1,
MilanLongInt adj2, MilanLongInt adj2,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanReal *edgeLocWeight); MilanReal *edgeLocWeight);
inline bool isAlreadyMatched(MilanLongInt node, void queuesTransfer(staticQueue &U,
staticQueue &privateU,
vector<MilanLongInt> &QLocalVtx,
vector<MilanLongInt> &QGhostVtx,
vector<MilanLongInt> &QMsgType,
vector<MilanInt> &QOwner,
staticQueue &privateQLocalVtx,
staticQueue &privateQGhostVtx,
staticQueue &privateQMsgType,
staticQueue &privateQOwner);
bool isAlreadyMatched(MilanLongInt node,
MilanLongInt StartIndex, MilanLongInt StartIndex,
MilanLongInt EndIndex, MilanLongInt EndIndex,
vector<MilanLongInt> &GMate, vector<MilanLongInt> &GMate,
MilanLongInt *Mate, MilanLongInt *Mate,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap); map<MilanLongInt, MilanLongInt> &Ghost2LocalMap);
inline MilanLongInt computeCandidateMate(MilanLongInt adj1, MilanLongInt computeCandidateMate(MilanLongInt adj1,
MilanLongInt adj2, MilanLongInt adj2,
MilanReal *edgeLocWeight, MilanReal *edgeLocWeight,
MilanLongInt k, MilanLongInt k,
@ -195,7 +207,7 @@ extern "C"
MilanLongInt *Mate, MilanLongInt *Mate,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap); map<MilanLongInt, MilanLongInt> &Ghost2LocalMap);
inline void initialize(MilanLongInt NLVer, MilanLongInt NLEdge, void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt StartIndex, MilanLongInt EndIndex, MilanLongInt StartIndex, MilanLongInt EndIndex,
MilanLongInt *numGhostEdgesPtr, MilanLongInt *numGhostEdgesPtr,
MilanLongInt *numGhostVerticesPtr, MilanLongInt *numGhostVerticesPtr,
@ -222,14 +234,27 @@ extern "C"
staticQueue &privateQMsgType, staticQueue &privateQMsgType,
staticQueue &privateQOwner); staticQueue &privateQOwner);
inline void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, void clean(MilanInt myRank,
MilanLongInt MessageIndex,
vector<MPI_Request> &SRequest,
vector<MPI_Status> &SStatus,
MilanInt BufferSize,
MilanLongInt *Buffer,
MilanLongInt msgActual,
MilanLongInt *msgActualSent,
MilanLongInt msgInd,
MilanLongInt *msgIndSent,
MilanLongInt NumMessagesBundled,
MilanReal *msgPercent);
void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanInt myRank, MilanInt myRank,
MilanReal *edgeLocWeight, MilanReal *edgeLocWeight,
MilanLongInt *candidateMate); MilanLongInt *candidateMate);
inline void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer, void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
MilanLongInt *candidateMate, MilanLongInt *candidateMate,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
@ -259,8 +284,34 @@ extern "C"
staticQueue &privateQMsgType, staticQueue &privateQMsgType,
staticQueue &privateQOwner); staticQueue &privateQOwner);
inline void queuesTransfer(staticQueue &U, void PROCESS_CROSS_EDGE(vector<MilanLongInt> &Counter,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
MilanLongInt edge,
MilanLongInt *SPtr);
void processMatchedVertices(
MilanLongInt NLVer,
vector<MilanLongInt> &UChunkBeingProcessed,
staticQueue &U,
staticQueue &privateU, staticQueue &privateU,
MilanLongInt StartIndex,
MilanLongInt EndIndex,
MilanLongInt *myCardPtr,
MilanLongInt *msgIndPtr,
MilanLongInt *NumMessagesBundledPtr,
MilanLongInt *SPtr,
MilanLongInt *verLocPtr,
MilanLongInt *verLocInd,
MilanLongInt *verDistance,
MilanLongInt *PCounter,
vector<MilanLongInt> &Counter,
MilanInt myRank,
MilanInt numProcs,
MilanLongInt *candidateMate,
vector<MilanLongInt> &GMate,
MilanLongInt *Mate,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
MilanReal *edgeLocWeight,
vector<MilanLongInt> &QLocalVtx, vector<MilanLongInt> &QLocalVtx,
vector<MilanLongInt> &QGhostVtx, vector<MilanLongInt> &QGhostVtx,
vector<MilanLongInt> &QMsgType, vector<MilanLongInt> &QMsgType,
@ -270,6 +321,45 @@ extern "C"
staticQueue &privateQMsgType, staticQueue &privateQMsgType,
staticQueue &privateQOwner); staticQueue &privateQOwner);
void sendBundledMessages(MilanLongInt *numGhostEdgesPtr,
MilanInt *BufferSizePtr,
MilanLongInt *Buffer,
vector<MilanLongInt> &PCumulative,
vector<MilanLongInt> &PMessageBundle,
vector<MilanLongInt> &PSizeInfoMessages,
MilanLongInt *PCounter,
MilanLongInt NumMessagesBundled,
MilanLongInt *msgActualPtr,
MilanLongInt *MessageIndexPtr,
MilanInt numProcs,
MilanInt myRank,
int ComputeTag,
int BundleTag,
MPI_Comm comm,
vector<MilanLongInt> &QLocalVtx,
vector<MilanLongInt> &QGhostVtx,
vector<MilanLongInt> &QMsgType,
vector<MilanInt> &QOwner,
vector<MPI_Request> &SRequest,
vector<MPI_Status> &SStatus);
void processMessages(int error_codeC,
MilanInt numProcs,
MilanInt myRank,
int ComputeTag,
int BundleTag,
MPI_Comm comm,
vector<MilanLongInt> &Message,
char *error_message,
int message_length,
vector<MilanLongInt> &ReceiveBuffer,
MilanLongInt *BundleSizePtr);
void extractUChunk(
vector<MilanLongInt> &UChunkBeingProcessed,
staticQueue &U,
staticQueue &privateU);
void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP( void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
MilanLongInt NLVer, MilanLongInt NLEdge, MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt *verLocPtr, MilanLongInt *verLocInd, MilanReal *edgeLocWeight, MilanLongInt *verLocPtr, MilanLongInt *verLocInd, MilanReal *edgeLocWeight,

@ -72,12 +72,6 @@
#ifdef SERIAL_MPI #ifdef SERIAL_MPI
#else #else
//MPI type map
template<typename T> MPI_Datatype TypeMap();
template<> inline MPI_Datatype TypeMap<int64_t>() { return MPI_LONG_LONG; }
template<> inline MPI_Datatype TypeMap<int>() { return MPI_INT; }
template<> inline MPI_Datatype TypeMap<double>() { return MPI_DOUBLE; }
template<> inline MPI_Datatype TypeMap<float>() { return MPI_FLOAT; }
// DOUBLE PRECISION VERSION // DOUBLE PRECISION VERSION
//WARNING: The vertex block on a given rank is contiguous //WARNING: The vertex block on a given rank is contiguous

@ -1,16 +1,4 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <omp.h>
#include <stdio.h>
#include "isAlreadyMatched.cpp"
#include "findOwnerOfGhost.cpp"
#include "computeCandidateMate.cpp"
#include "initialize.cpp"
#include "parallelComputeCandidateMateB.cpp"
#include "processExposedVertex.cpp"
#include "processMatchedVertices.cpp"
#include "sendBundledMessages.cpp"
#include "processMessages.cpp"
#include "clean.cpp"
// *********************************************************************** // ***********************************************************************
// //

@ -1,19 +1,10 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <assert.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
//TODO comment //TODO comment
//TODO use task //TODO use task
//TODO destroy the locks //TODO destroy the locks
inline void clean(MilanInt myRank, void clean(MilanInt myRank,
MilanLongInt MessageIndex, MilanLongInt MessageIndex,
vector<MPI_Request> &SRequest, vector<MPI_Request> &SRequest,
vector<MPI_Status> &SStatus, vector<MPI_Status> &SStatus,

@ -9,7 +9,7 @@
* @param edgeLocWeight * @param edgeLocWeight
* @return * @return
*/ */
inline MilanLongInt firstComputeCandidateMate(MilanLongInt adj1, MilanLongInt firstComputeCandidateMate(MilanLongInt adj1,
MilanLongInt adj2, MilanLongInt adj2,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanReal *edgeLocWeight) MilanReal *edgeLocWeight)
@ -45,7 +45,7 @@ inline MilanLongInt firstComputeCandidateMate(MilanLongInt adj1,
* @param Ghost2LocalMap * @param Ghost2LocalMap
* @return * @return
*/ */
inline MilanLongInt computeCandidateMate(MilanLongInt adj1, MilanLongInt computeCandidateMate(MilanLongInt adj1,
MilanLongInt adj2, MilanLongInt adj2,
MilanReal *edgeLocWeight, MilanReal *edgeLocWeight,
MilanLongInt k, MilanLongInt k,

@ -1,15 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
#define UCHUNK 1000 void extractUChunk(
inline void extractUChunk(
vector<MilanLongInt> &UChunkBeingProcessed, vector<MilanLongInt> &UChunkBeingProcessed,
staticQueue &U, staticQueue &U,
staticQueue &privateU) staticQueue &privateU)

@ -1,13 +1,7 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
///Find the owner of a ghost node: ///Find the owner of a ghost node:
inline MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance, MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
MilanInt myRank, MilanInt numProcs) { MilanInt myRank, MilanInt numProcs) {
//MilanLongInt Size = mVerDistance.size(); //MilanLongInt Size = mVerDistance.size();
MilanLongInt mStartInd = mVerDistance[myRank]; MilanLongInt mStartInd = mVerDistance[myRank];

@ -1,16 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream> void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
#include <assert.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
#define NUM_THREAD 4
inline void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt StartIndex, MilanLongInt EndIndex, MilanLongInt StartIndex, MilanLongInt EndIndex,
MilanLongInt *numGhostEdgesPtr, MilanLongInt *numGhostEdgesPtr,
MilanLongInt *numGhostVerticesPtr, MilanLongInt *numGhostVerticesPtr,

@ -1,10 +1,4 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
/** /**
* //TODO documentation * //TODO documentation
@ -17,7 +11,7 @@
* @param Ghost2LocalMap * @param Ghost2LocalMap
* @return * @return
*/ */
inline bool isAlreadyMatched(MilanLongInt node, bool isAlreadyMatched(MilanLongInt node,
MilanLongInt StartIndex, MilanLongInt StartIndex,
MilanLongInt EndIndex, MilanLongInt EndIndex,
vector <MilanLongInt> &GMate, vector <MilanLongInt> &GMate,

@ -1,14 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <assert.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
inline void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanInt myRank, MilanInt myRank,

@ -1,14 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <assert.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
inline void PROCESS_CROSS_EDGE(vector<MilanLongInt> &Counter, void PROCESS_CROSS_EDGE(vector<MilanLongInt> &Counter,
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap, map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
MilanLongInt edge, MilanLongInt edge,
MilanLongInt *SPtr) MilanLongInt *SPtr)

@ -1,16 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream> void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
#include <assert.h>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
#include "queueTransfer.cpp"
#include "processCrossEdge.cpp"
inline void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
MilanLongInt *candidateMate, MilanLongInt *candidateMate,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,

@ -1,16 +1,8 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
#include "extractUChunk.cpp"
//#define privateQueues //#define privateQueues
inline void processMatchedVertices( void processMatchedVertices(
MilanLongInt NLVer, MilanLongInt NLVer,
vector<MilanLongInt> &UChunkBeingProcessed, vector<MilanLongInt> &UChunkBeingProcessed,
staticQueue &U, staticQueue &U,
@ -61,6 +53,7 @@ inline void processMatchedVertices(
#endif #endif
// TODO what would be the optimal UCHUNK // TODO what would be the optimal UCHUNK
// TODO refactor
vector<MilanLongInt> UChunkBeingProcessed; vector<MilanLongInt> UChunkBeingProcessed;
UChunkBeingProcessed.reserve(UCHUNK); UChunkBeingProcessed.reserve(UCHUNK);

@ -1,13 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
inline void processMessages(int error_codeC, void processMessages(int error_codeC,
MilanInt numProcs, MilanInt numProcs,
MilanInt myRank, MilanInt myRank,
int ComputeTag, int ComputeTag,

@ -1,13 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream>
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
inline void queuesTransfer(staticQueue &U, void queuesTransfer(staticQueue &U,
staticQueue &privateU, staticQueue &privateU,
vector<MilanLongInt> &QLocalVtx, vector<MilanLongInt> &QLocalVtx,
vector<MilanLongInt> &QGhostVtx, vector<MilanLongInt> &QGhostVtx,

@ -1,13 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#include <stdio.h>
#include <iostream> void sendBundledMessages(MilanLongInt *numGhostEdgesPtr,
#include <map>
#include <vector>
#include "primitiveDataTypeDefinitions.h"
#include "dataStrStaticQueue.h"
#include "omp.h"
inline void sendBundledMessages(MilanLongInt *numGhostEdgesPtr,
MilanInt *BufferSizePtr, MilanInt *BufferSizePtr,
MilanLongInt *Buffer, MilanLongInt *Buffer,
vector<MilanLongInt> &PCumulative, vector<MilanLongInt> &PCumulative,

Loading…
Cancel
Save