|
|
@ -1,6 +1,5 @@
|
|
|
|
#include "MatchBoxPC.h"
|
|
|
|
#include "MatchBoxPC.h"
|
|
|
|
|
|
|
|
|
|
|
|
//TODO can be optimized!!
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* //TODO documentation
|
|
|
|
* //TODO documentation
|
|
|
|
* @param k
|
|
|
|
* @param k
|
|
|
@ -17,10 +16,10 @@ bool isAlreadyMatched(MilanLongInt node,
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
MilanLongInt EndIndex,
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
vector<MilanLongInt> &GMate,
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
MilanLongInt *Mate,
|
|
|
|
map <MilanLongInt, MilanLongInt> &Ghost2LocalMap
|
|
|
|
map<MilanLongInt, MilanLongInt> &Ghost2LocalMap)
|
|
|
|
) {
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
/*
|
|
|
|
#pragma omp critical(Mate)
|
|
|
|
#pragma omp critical(Mate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ((node < StartIndex) || (node > EndIndex)) { //Is it a ghost vertex?
|
|
|
|
if ((node < StartIndex) || (node > EndIndex)) { //Is it a ghost vertex?
|
|
|
@ -30,6 +29,18 @@ bool isAlreadyMatched(MilanLongInt node,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
MilanLongInt val;
|
|
|
|
|
|
|
|
if ((node < StartIndex) || (node > EndIndex)) // if ghost vertex
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#pragma omp atomic read
|
|
|
|
|
|
|
|
val = GMate[Ghost2LocalMap[node]];
|
|
|
|
|
|
|
|
return val >= 0; // Already matched
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If not ghost vertex
|
|
|
|
|
|
|
|
#pragma omp atomic read
|
|
|
|
|
|
|
|
val = Mate[node - StartIndex];
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return val >= 0; // Already matched
|
|
|
|
}
|
|
|
|
}
|