Fixed openmp usage
This commit is contained in:
parent
ab36a5b24a
commit
8198cef3c5
3 changed files with 10 additions and 7 deletions
|
@ -9,10 +9,10 @@ SET(CosmoTool_SRCS
|
|||
miniargs.cpp
|
||||
growthFactor.cpp
|
||||
cosmopower.cpp
|
||||
cic.cpp
|
||||
)
|
||||
|
||||
IF (ENABLE_OPENMP)
|
||||
set(CosmoTool_SRCS ${CosmoTool_SRCS} cic.cpp)
|
||||
ENDIF (ENABLE_OPENMP)
|
||||
|
||||
IF(FOUND_NETCDF3)
|
||||
|
|
|
@ -32,7 +32,7 @@ same conditions as regards security.
|
|||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
+*/
|
||||
#include <omp.h>
|
||||
#include "openmp.hpp"
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <inttypes.h>
|
||||
|
@ -62,7 +62,7 @@ void CICFilter::resetMesh()
|
|||
|
||||
void CICFilter::putParticles(CICParticles *particles, uint32_t N)
|
||||
{
|
||||
int threadUsed = omp_get_max_threads();
|
||||
int threadUsed = smp_get_max_threads();
|
||||
double *threadedDensity[threadUsed];
|
||||
bool threadActivated[threadUsed];
|
||||
uint32_t tUsedMin[threadUsed], tUsedMax[threadUsed];
|
||||
|
@ -79,7 +79,7 @@ void CICFilter::putParticles(CICParticles *particles, uint32_t N)
|
|||
|
||||
#pragma omp parallel
|
||||
{
|
||||
int thisThread = omp_get_thread_num();
|
||||
int thisThread = smp_get_thread_id();
|
||||
double *dg = threadedDensity[thisThread];
|
||||
|
||||
threadActivated[thisThread] = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue