Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
89673b3f
Commit
89673b3f
authored
9 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix compilation warnings
parent
76098ab2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Mesh/Generator.cpp
+1
-1
1 addition, 1 deletion
Mesh/Generator.cpp
Mesh/delaunay3d.cpp
+20
-8
20 additions, 8 deletions
Mesh/delaunay3d.cpp
Mesh/delaunay3d_private.h
+10
-7
10 additions, 7 deletions
Mesh/delaunay3d_private.h
with
31 additions
and
16 deletions
Mesh/Generator.cpp
+
1
−
1
View file @
89673b3f
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Mesh/delaunay3d.cpp
+
20
−
8
View file @
89673b3f
...
@@ -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
def
ined(
_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
def
ined(
_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
def
ined(
_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
def
ined(
_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
def
ined(
_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
def
ined(
_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: "
);
...
...
This diff is collapsed.
Click to expand it.
Mesh/delaunay3d_private.h
+
10
−
7
View file @
89673b3f
...
@@ -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
def
ined(
_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
def
ined(
_OPENMP
)
int
myThread
=
omp_get_thread_num
();
int
myThread
=
omp_get_thread_num
();
#else
#else
int
myThread
=
0
;
int
myThread
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment