mirror of
https://github.com/cosmo-sims/MUSIC.git
synced 2024-09-19 17:03:46 +02:00
fixed compilation error (convex_hull.hh) when OpenMP is not available
This commit is contained in:
parent
1a15acfe02
commit
44cdfc728b
1 changed files with 8 additions and 2 deletions
|
@ -5,7 +5,9 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#ifdef _OPENMP
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
|
|
||||||
|
@ -286,8 +288,10 @@ struct convex_hull{
|
||||||
for( j=i, l=0; l<npoints_; ++l )
|
for( j=i, l=0; l<npoints_; ++l )
|
||||||
if( i!=l && turn(&points[3*i],&points[3*j],&points[3*l]) >= 0 ) j=l;
|
if( i!=l && turn(&points[3*i],&points[3*j],&points[3*l]) >= 0 ) j=l;
|
||||||
|
|
||||||
|
#ifdef _OPENMP
|
||||||
int nt = omp_get_max_threads();
|
int nt = omp_get_max_threads();
|
||||||
omp_set_num_threads( std::min(2,omp_get_max_threads()) );
|
omp_set_num_threads( std::min(2,omp_get_max_threads()) );
|
||||||
|
#endif
|
||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for( int thread=0; thread<2; ++thread )
|
for( int thread=0; thread<2; ++thread )
|
||||||
|
@ -298,7 +302,9 @@ struct convex_hull{
|
||||||
wrap<false>( points, i, j, faceidx_U_ );
|
wrap<false>( points, i, j, faceidx_U_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _OPENMP
|
||||||
omp_set_num_threads(nt);
|
omp_set_num_threads(nt);
|
||||||
|
#endif
|
||||||
|
|
||||||
compute_face_normals( points );
|
compute_face_normals( points );
|
||||||
compute_center( points );
|
compute_center( points );
|
||||||
|
|
Loading…
Reference in a new issue