Skip to content
Snippets Groups Projects
Commit d790d76b authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

more enhancements, bu i still have 30% of performances to recover from my standalone code

parent 5460fbfa
Branches
Tags
No related merge requests found
...@@ -517,7 +517,7 @@ static Tet* randomTet (int thread, tetContainer &allocator ){ ...@@ -517,7 +517,7 @@ static Tet* randomTet (int thread, tetContainer &allocator ){
} }
//#define _VERBOSE 1 #define _VERBOSE 1
void delaunayTrgl (const unsigned int numThreads, void delaunayTrgl (const unsigned int numThreads,
const unsigned int NPTS_AT_ONCE, const unsigned int NPTS_AT_ONCE,
unsigned int Npts, unsigned int Npts,
...@@ -528,7 +528,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -528,7 +528,7 @@ void delaunayTrgl (const unsigned int numThreads,
double totCavityGlob=0; double totCavityGlob=0;
#endif #endif
// checkLocalDelaunayness(T, "initial"); // checkLocalDelaunayness(allocator, 0, "initial");
std::vector<int> invalidCavities(numThreads); std::vector<int> invalidCavities(numThreads);
std::vector<int> cacheMisses(numThreads, 0); std::vector<int> cacheMisses(numThreads, 0);
...@@ -552,6 +552,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -552,6 +552,7 @@ void delaunayTrgl (const unsigned int numThreads,
double totCavity=0; double totCavity=0;
std::vector<cavityContainer> cavity(NPTS_AT_ONCE); std::vector<cavityContainer> cavity(NPTS_AT_ONCE);
std::vector<connContainer> bnd(NPTS_AT_ONCE); std::vector<connContainer> bnd(NPTS_AT_ONCE);
std::vector<bool> ok(NPTS_AT_ONCE);
connContainer faceToTet; connContainer faceToTet;
std::vector<Tet*> Choice(NPTS_AT_ONCE); std::vector<Tet*> Choice(NPTS_AT_ONCE);
for (unsigned int K=0;K<NPTS_AT_ONCE;K++)Choice[K] = randomTet (myThread, allocator); for (unsigned int K=0;K<NPTS_AT_ONCE;K++)Choice[K] = randomTet (myThread, allocator);
...@@ -631,7 +632,6 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -631,7 +632,6 @@ void delaunayTrgl (const unsigned int numThreads,
#pragma omp barrier #pragma omp barrier
std::vector<bool> ok(NPTS_AT_ONCE);
for (unsigned int K=0; K< NPTS_AT_ONCE; K++) { for (unsigned int K=0; K< NPTS_AT_ONCE; K++) {
if (!vToAdd[K])ok[K]=false; if (!vToAdd[K])ok[K]=false;
else ok[K] = canWeProcessCavity (cavity[K], myThread, K); else ok[K] = canWeProcessCavity (cavity[K], myThread, K);
...@@ -648,13 +648,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -648,13 +648,7 @@ void delaunayTrgl (const unsigned int numThreads,
Choice[K] = cavityK[0]; Choice[K] = cavityK[0];
for (unsigned int i=0; i<bSize; i++) { for (unsigned int i=0; i<bSize; i++) {
// reuse memory slots of invalid elements // reuse memory slots of invalid elements
Tet *t; Tet *t = (i < cSize)? cavityK[i] : allocator.newTet(myThread);
if (i < cSize) {
t = cavityK[i];
}
else {
t = allocator.newTet(myThread);
}
if (i < cSize && t->V[0]->_thread != myThread)cacheMisses[myThread]++; if (i < cSize && t->V[0]->_thread != myThread)cacheMisses[myThread]++;
t->setVerticesNoTest (bndK[i].f.V[0], bndK[i].f.V[1], bndK[i].f.V[2], vToAdd[K]); t->setVerticesNoTest (bndK[i].f.V[0], bndK[i].f.V[1], bndK[i].f.V[2], vToAdd[K]);
Tet *neigh = bndK[i].t; Tet *neigh = bndK[i].t;
...@@ -672,7 +666,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -672,7 +666,7 @@ void delaunayTrgl (const unsigned int numThreads,
computeAdjacencies (t,3,faceToTet); computeAdjacencies (t,3,faceToTet);
} }
for (unsigned int i=bSize; i<cSize; i++) { for (unsigned int i=bSize; i<cSize; i++) {
cavityK[i]->V[0] = cavityK[i]->V[1] = cavityK[i]->V[2] = cavityK[i]->V[3] = NULL; cavityK[i]->V[0] = NULL;
} }
} }
} }
......
...@@ -140,9 +140,9 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 & ...@@ -140,9 +140,9 @@ void saturateEdge (Edge &e, std::vector<Vertex*> &S, double (*f)(const SPoint3 &
else { else {
SPoint3 p = p1 * (1.-t) + p2*t; SPoint3 p = p1 * (1.-t) + p2*t;
double lc = e.first->lc() * (1.-t) + e.second->lc()*t; double lc = e.first->lc() * (1.-t) + e.second->lc()*t;
const double dx = 1.e-10 * (double) rand() / RAND_MAX; const double dx = 1.e-12 * (double) rand() / RAND_MAX;
const double dy = 1.e-10 * (double) rand() / RAND_MAX; const double dy = 1.e-12 * (double) rand() / RAND_MAX;
const double dz = 1.e-10 * (double) rand() / RAND_MAX; const double dz = 1.e-12 * (double) rand() / RAND_MAX;
S.push_back(new Vertex(p.x()+dx,p.y()+dy,p.z()+dz,lc)); S.push_back(new Vertex(p.x()+dx,p.y()+dy,p.z()+dz,lc));
L += interval; L += interval;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment