|
|
|
@ -64,7 +64,10 @@
|
|
|
|
|
#include "dataStrStaticQueue.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
#define NUM_THREAD 4
|
|
|
|
|
#define UCHUNK 1000
|
|
|
|
|
|
|
|
|
|
const MilanLongInt REQUEST = 1;
|
|
|
|
|
const MilanLongInt SUCCESS = 2;
|
|
|
|
|
const MilanLongInt FAILURE = 3;
|
|
|
|
@ -166,119 +169,206 @@ extern "C"
|
|
|
|
|
#define MilanRealMin MINUS_INFINITY
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Function of find the owner of a ghost vertex using binary search:
|
|
|
|
|
inline MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
|
|
|
|
|
MilanInt myRank, MilanInt numProcs);
|
|
|
|
|
|
|
|
|
|
inline MilanLongInt firstComputeCandidateMate(MilanLongInt adj1,
|
|
|
|
|
MilanLongInt adj2,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanReal *edgeLocWeight);
|
|
|
|
|
|
|
|
|
|
inline bool isAlreadyMatched(MilanLongInt node,
|
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap);
|
|
|
|
|
|
|
|
|
|
inline MilanLongInt computeCandidateMate(MilanLongInt adj1,
|
|
|
|
|
MilanLongInt adj2,
|
|
|
|
|
MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt k,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap);
|
|
|
|
|
|
|
|
|
|
inline void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
|
|
|
|
|
MilanLongInt StartIndex, MilanLongInt EndIndex,
|
|
|
|
|
MilanLongInt *numGhostEdgesPtr,
|
|
|
|
|
MilanLongInt *numGhostVerticesPtr,
|
|
|
|
|
MilanLongInt *S,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
|
omp_lock_t *MateLock,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
|
|
|
|
|
vector<MilanLongInt> &Counter,
|
|
|
|
|
vector<MilanLongInt> &verGhostPtr,
|
|
|
|
|
vector<MilanLongInt> &verGhostInd,
|
|
|
|
|
vector<MilanLongInt> &tempCounter,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
vector<MilanLongInt> &Message,
|
|
|
|
|
vector<MilanLongInt> &QLocalVtx,
|
|
|
|
|
vector<MilanLongInt> &QGhostVtx,
|
|
|
|
|
vector<MilanLongInt> &QMsgType,
|
|
|
|
|
vector<MilanInt> &QOwner,
|
|
|
|
|
MilanLongInt *&candidateMate,
|
|
|
|
|
staticQueue &U,
|
|
|
|
|
staticQueue &privateU,
|
|
|
|
|
staticQueue &privateQLocalVtx,
|
|
|
|
|
staticQueue &privateQGhostVtx,
|
|
|
|
|
staticQueue &privateQMsgType,
|
|
|
|
|
staticQueue &privateQOwner);
|
|
|
|
|
|
|
|
|
|
inline void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
|
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanInt myRank,
|
|
|
|
|
MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt *candidateMate);
|
|
|
|
|
|
|
|
|
|
inline void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
|
|
|
|
|
MilanLongInt *candidateMate,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
|
|
|
|
|
MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt *myCardPtr,
|
|
|
|
|
MilanLongInt *msgIndPtr,
|
|
|
|
|
MilanLongInt *NumMessagesBundledPtr,
|
|
|
|
|
MilanLongInt *SPtr,
|
|
|
|
|
MilanLongInt *verDistance,
|
|
|
|
|
MilanLongInt *PCounter,
|
|
|
|
|
vector<MilanLongInt> &Counter,
|
|
|
|
|
MilanInt myRank,
|
|
|
|
|
MilanInt numProcs,
|
|
|
|
|
staticQueue &U,
|
|
|
|
|
staticQueue &privateU,
|
|
|
|
|
vector<MilanLongInt> &QLocalVtx,
|
|
|
|
|
vector<MilanLongInt> &QGhostVtx,
|
|
|
|
|
vector<MilanLongInt> &QMsgType,
|
|
|
|
|
vector<MilanInt> &QOwner,
|
|
|
|
|
staticQueue &privateQLocalVtx,
|
|
|
|
|
staticQueue &privateQGhostVtx,
|
|
|
|
|
staticQueue &privateQMsgType,
|
|
|
|
|
staticQueue &privateQOwner);
|
|
|
|
|
|
|
|
|
|
inline 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);
|
|
|
|
|
|
|
|
|
|
void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
|
|
|
|
|
MilanLongInt NLVer, MilanLongInt NLEdge,
|
|
|
|
|
MilanLongInt *verLocPtr, MilanLongInt *verLocInd, MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt *verDistance,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
MilanInt myRank, MilanInt numProcs, MPI_Comm comm,
|
|
|
|
|
MilanLongInt *msgIndSent, MilanLongInt *msgActualSent, MilanReal *msgPercent,
|
|
|
|
|
MilanReal *ph0_time, MilanReal *ph1_time, MilanReal *ph2_time,
|
|
|
|
|
MilanLongInt *ph1_card, MilanLongInt *ph2_card);
|
|
|
|
|
MilanInt findOwnerOfGhost(MilanLongInt vtxIndex, MilanLongInt *mVerDistance,
|
|
|
|
|
MilanInt myRank, MilanInt numProcs);
|
|
|
|
|
|
|
|
|
|
MilanLongInt firstComputeCandidateMate(MilanLongInt adj1,
|
|
|
|
|
MilanLongInt adj2,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanReal *edgeLocWeight);
|
|
|
|
|
|
|
|
|
|
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 EndIndex,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap);
|
|
|
|
|
|
|
|
|
|
MilanLongInt computeCandidateMate(MilanLongInt adj1,
|
|
|
|
|
MilanLongInt adj2,
|
|
|
|
|
MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt k,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap);
|
|
|
|
|
|
|
|
|
|
void initialize(MilanLongInt NLVer, MilanLongInt NLEdge,
|
|
|
|
|
MilanLongInt StartIndex, MilanLongInt EndIndex,
|
|
|
|
|
MilanLongInt *numGhostEdgesPtr,
|
|
|
|
|
MilanLongInt *numGhostVerticesPtr,
|
|
|
|
|
MilanLongInt *S,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
|
omp_lock_t *MateLock,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
|
|
|
|
|
vector<MilanLongInt> &Counter,
|
|
|
|
|
vector<MilanLongInt> &verGhostPtr,
|
|
|
|
|
vector<MilanLongInt> &verGhostInd,
|
|
|
|
|
vector<MilanLongInt> &tempCounter,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
vector<MilanLongInt> &Message,
|
|
|
|
|
vector<MilanLongInt> &QLocalVtx,
|
|
|
|
|
vector<MilanLongInt> &QGhostVtx,
|
|
|
|
|
vector<MilanLongInt> &QMsgType,
|
|
|
|
|
vector<MilanInt> &QOwner,
|
|
|
|
|
MilanLongInt *&candidateMate,
|
|
|
|
|
staticQueue &U,
|
|
|
|
|
staticQueue &privateU,
|
|
|
|
|
staticQueue &privateQLocalVtx,
|
|
|
|
|
staticQueue &privateQGhostVtx,
|
|
|
|
|
staticQueue &privateQMsgType,
|
|
|
|
|
staticQueue &privateQOwner);
|
|
|
|
|
|
|
|
|
|
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 *verLocInd,
|
|
|
|
|
MilanInt myRank,
|
|
|
|
|
MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt *candidateMate);
|
|
|
|
|
|
|
|
|
|
void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
|
|
|
|
|
MilanLongInt *candidateMate,
|
|
|
|
|
MilanLongInt *verLocInd,
|
|
|
|
|
MilanLongInt *verLocPtr,
|
|
|
|
|
MilanLongInt StartIndex,
|
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap,
|
|
|
|
|
MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt *myCardPtr,
|
|
|
|
|
MilanLongInt *msgIndPtr,
|
|
|
|
|
MilanLongInt *NumMessagesBundledPtr,
|
|
|
|
|
MilanLongInt *SPtr,
|
|
|
|
|
MilanLongInt *verDistance,
|
|
|
|
|
MilanLongInt *PCounter,
|
|
|
|
|
vector<MilanLongInt> &Counter,
|
|
|
|
|
MilanInt myRank,
|
|
|
|
|
MilanInt numProcs,
|
|
|
|
|
staticQueue &U,
|
|
|
|
|
staticQueue &privateU,
|
|
|
|
|
vector<MilanLongInt> &QLocalVtx,
|
|
|
|
|
vector<MilanLongInt> &QGhostVtx,
|
|
|
|
|
vector<MilanLongInt> &QMsgType,
|
|
|
|
|
vector<MilanInt> &QOwner,
|
|
|
|
|
staticQueue &privateQLocalVtx,
|
|
|
|
|
staticQueue &privateQGhostVtx,
|
|
|
|
|
staticQueue &privateQMsgType,
|
|
|
|
|
staticQueue &privateQOwner);
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
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> &QGhostVtx,
|
|
|
|
|
vector<MilanLongInt> &QMsgType,
|
|
|
|
|
vector<MilanInt> &QOwner,
|
|
|
|
|
staticQueue &privateQLocalVtx,
|
|
|
|
|
staticQueue &privateQGhostVtx,
|
|
|
|
|
staticQueue &privateQMsgType,
|
|
|
|
|
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(
|
|
|
|
|
MilanLongInt NLVer, MilanLongInt NLEdge,
|
|
|
|
|
MilanLongInt *verLocPtr, MilanLongInt *verLocInd, MilanReal *edgeLocWeight,
|
|
|
|
|
MilanLongInt *verDistance,
|
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
|
MilanInt myRank, MilanInt numProcs, MPI_Comm comm,
|
|
|
|
|
MilanLongInt *msgIndSent, MilanLongInt *msgActualSent, MilanReal *msgPercent,
|
|
|
|
|
MilanReal *ph0_time, MilanReal *ph1_time, MilanReal *ph2_time,
|
|
|
|
|
MilanLongInt *ph1_card, MilanLongInt *ph2_card);
|
|
|
|
|
|
|
|
|
|
void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC(
|
|
|
|
|
MilanLongInt NLVer, MilanLongInt NLEdge,
|
|
|
|
|