Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit c9a00713 authored by BRAMAS Berenger's avatar BRAMAS Berenger

update the kernel copies and use a more clean code

parent f8253c77
...@@ -77,11 +77,11 @@ public: ...@@ -77,11 +77,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3"); FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmSectionTask) #pragma omp critical (InitFFmmAlgorithmSectionTask)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
......
...@@ -66,13 +66,13 @@ public: ...@@ -66,13 +66,13 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3"); FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmTask) #pragma omp critical (InitFFmmAlgorithmTask)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight()); FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
......
...@@ -85,11 +85,11 @@ public: ...@@ -85,11 +85,11 @@ public:
FAssertLF(0 < userChunkSize, "Chunk size should be > 0"); FAssertLF(0 < userChunkSize, "Chunk size should be > 0");
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmThread) #pragma omp critical (InitFFmmAlgorithmThread)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
......
...@@ -62,11 +62,11 @@ public: ...@@ -62,11 +62,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3"); FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmThreadBalance) #pragma omp critical (InitFFmmAlgorithmThreadBalance)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
......
...@@ -157,11 +157,11 @@ public: ...@@ -157,11 +157,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3"); FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmThreadProc) #pragma omp critical (InitFFmmAlgorithmThreadProc)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
......
...@@ -117,11 +117,11 @@ public: ...@@ -117,11 +117,11 @@ public:
void setKernel(KernelClass*const inKernels){ void setKernel(KernelClass*const inKernels){
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmThreadProcPeriodic) #pragma omp critical (InitFFmmAlgorithmThreadProcPeriodic)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
} }
......
...@@ -71,11 +71,11 @@ public: ...@@ -71,11 +71,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3"); FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads]; this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static) #pragma omp parallel num_threads(MaxThreads)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){ {
#pragma omp critical (InitFFmmAlgorithmThreadTsm) #pragma omp critical (InitFFmmAlgorithmTsm)
{ {
this->kernels[idxThread] = new KernelClass(*inKernels); this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment