Skip to content
Snippets Groups Projects
Commit 89673b3f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix compilation warnings

parent 76098ab2
No related branches found
No related tags found
No related merge requests found
...@@ -619,7 +619,7 @@ bool MakeMeshConformal(GModel *gm, int howto) ...@@ -619,7 +619,7 @@ bool MakeMeshConformal(GModel *gm, int howto)
} }
} }
// HEX IS ONLY SURROUNED BY COMPATIBLE ELEMENTS // HEX IS ONLY SURROUNED BY COMPATIBLE ELEMENTS
if (faces.size() == e->getNumFaces()){ if ((int)faces.size() == e->getNumFaces()){
remainingHexes.push_back(e); remainingHexes.push_back(e);
} }
else { else {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>. // bugs and problems to the public mailing list <gmsh@onelab.info>.
#ifdef _OPENMP #if defined(_OPENMP)
#include <omp.h> #include <omp.h>
#endif #endif
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "MTetrahedron.h" #include "MTetrahedron.h"
#include "meshGRegionLocalMeshMod.h" #include "meshGRegionLocalMeshMod.h"
#ifdef _HAVE_NUMA #if defined(_HAVE_NUMA)
#include <numa.h> #include <numa.h>
#endif #endif
...@@ -914,7 +914,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -914,7 +914,7 @@ void delaunayTrgl (const unsigned int numThreads,
tetContainer &allocator, tetContainer &allocator,
double threshold) double threshold)
{ {
#ifdef _VERBOSE #if defined(_VERBOSE)
double totSearchGlob=0; double totSearchGlob=0;
double totCavityGlob=0; double totCavityGlob=0;
#endif #endif
...@@ -932,10 +932,12 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -932,10 +932,12 @@ void delaunayTrgl (const unsigned int numThreads,
maxLocSizeK = std::max(maxLocSizeK, s); maxLocSizeK = std::max(maxLocSizeK, s);
} }
#if defined(_OPENMP)
#pragma omp parallel num_threads(numThreads) #pragma omp parallel num_threads(numThreads)
#endif
{ {
#ifdef _OPENMP #if defined(_OPENMP)
int myThread = omp_get_thread_num(); int myThread = omp_get_thread_num();
#else #else
int myThread = 0; int myThread = 0;
...@@ -959,7 +961,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -959,7 +961,7 @@ void delaunayTrgl (const unsigned int numThreads,
for (unsigned int K=0;K<NPTS_AT_ONCE;K++){ for (unsigned int K=0;K<NPTS_AT_ONCE;K++){
locSizeK[K] = assignTo[K+myThread*NPTS_AT_ONCE].size(); locSizeK[K] = assignTo[K+myThread*NPTS_AT_ONCE].size();
locSize += locSizeK[K]; locSize += locSizeK[K];
#ifdef _HAVE_NUMA #if defined(_HAVE_NUMA)
allocatedVerts [K] = (Vertex*)numa_alloc_local (locSizeK[K]*sizeof(Vertex)); allocatedVerts [K] = (Vertex*)numa_alloc_local (locSizeK[K]*sizeof(Vertex));
#else #else
// allocatedVerts [K] = (Vertex*)calloc (locSizeK[K],sizeof(Vertex)); // allocatedVerts [K] = (Vertex*)calloc (locSizeK[K],sizeof(Vertex));
...@@ -973,13 +975,18 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -973,13 +975,18 @@ void delaunayTrgl (const unsigned int numThreads,
std::vector<Vertex*> vToAdd(NPTS_AT_ONCE); std::vector<Vertex*> vToAdd(NPTS_AT_ONCE);
#if defined(_OPENMP)
#pragma omp barrier #pragma omp barrier
#endif
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
////////////////////////// M A I N L O O P /////////////////////////////////////// ////////////////////////// M A I N L O O P ///////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
for (unsigned int iPGlob=0 ; iPGlob < maxLocSizeK; iPGlob++){ for (unsigned int iPGlob=0 ; iPGlob < maxLocSizeK; iPGlob++){
#if defined(_OPENMP)
#pragma omp barrier #pragma omp barrier
#endif
std::vector<Tet*> t(NPTS_AT_ONCE); std::vector<Tet*> t(NPTS_AT_ONCE);
// double c1 = Cpu(); // double c1 = Cpu();
// FIND SEEDS // FIND SEEDS
...@@ -1020,8 +1027,9 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -1020,8 +1027,9 @@ void delaunayTrgl (const unsigned int numThreads,
// t3 += Cpu() - t1; // t3 += Cpu() - t1;
#if defined(_OPENMP)
#pragma omp barrier #pragma omp barrier
#endif
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);
...@@ -1063,14 +1071,18 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -1063,14 +1071,18 @@ void delaunayTrgl (const unsigned int numThreads,
} }
// t4 += Cpu() - t1; // t4 += Cpu() - t1;
} }
#ifdef _VERBOSE #if defined(_VERBOSE)
#if defined(_OPENMP)
#pragma omp critical #pragma omp critical
#endif
{ {
totCavityGlob+= totCavity; totCavityGlob+= totCavity;
totSearchGlob+= totSearch; totSearchGlob+= totSearch;
} }
#endif #endif
#if defined(_OPENMP)
#pragma omp barrier #pragma omp barrier
#endif
// clear last cavity // clear last cavity
for (unsigned int K=0; K< NPTS_AT_ONCE; K++) { for (unsigned int K=0; K< NPTS_AT_ONCE; K++) {
for (unsigned int i=0; i<cavity[K].size(); i++)cavity[K][i]->unset(myThread,K); for (unsigned int i=0; i<cavity[K].size(); i++)cavity[K][i]->unset(myThread,K);
...@@ -1085,7 +1097,7 @@ void delaunayTrgl (const unsigned int numThreads, ...@@ -1085,7 +1097,7 @@ void delaunayTrgl (const unsigned int numThreads,
// printf(" %12.5E %12.5E %12.5E tot %12.5E \n",t2,t3,t4,t2+t3+t4); // printf(" %12.5E %12.5E %12.5E tot %12.5E \n",t2,t3,t4,t2+t3+t4);
#ifdef _VERBOSE #if defined(_VERBOSE)
printf("average searches per point %12.5E\n",totSearchGlob/Npts); printf("average searches per point %12.5E\n",totSearchGlob/Npts);
printf("average size for del cavity %12.5E\n",totCavityGlob/Npts); printf("average size for del cavity %12.5E\n",totCavityGlob/Npts);
printf("cache misses: "); printf("cache misses: ");
......
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>. // bugs and problems to the public mailing list <gmsh@onelab.info>.
#ifndef _DELAUNAY3D_H_ #ifndef _DELAUNAY3D_PRIVATE_H_
#define _DELAUNAY3D_H_ #define _DELAUNAY3D_PRIVATE_H_
#include <vector> #include <vector>
#include "SPoint3.h" #include "SPoint3.h"
#include <math.h> #include <math.h>
#include "robustPredicates.h" #include "robustPredicates.h"
#include <stdio.h> #include <stdio.h>
#ifdef _OPENMP #if defined(_OPENMP)
#include <omp.h> #include <omp.h>
#endif #endif
...@@ -293,9 +294,11 @@ class tetContainer { ...@@ -293,9 +294,11 @@ class tetContainer {
// FIXME !!! // FIXME !!!
if (nbThreads != 1) throw; if (nbThreads != 1) throw;
_perThread.resize(nbThreads); _perThread.resize(nbThreads);
#if defined(_OPENMP)
#pragma omp parallel num_threads(nbThreads) #pragma omp parallel num_threads(nbThreads)
#endif
{ {
#ifdef _OPENMP #if defined(_OPENMP)
int myThread = omp_get_thread_num(); int myThread = omp_get_thread_num();
#else #else
int myThread = 0; int myThread = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment