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:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmSectionTask)
{
this->kernels[idxThread] = new KernelClass(*inKernels);
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
......
......@@ -66,13 +66,13 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp critical (InitFFmmAlgorithmTask)
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmTask)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
......
......@@ -85,11 +85,11 @@ public:
FAssertLF(0 < userChunkSize, "Chunk size should be > 0");
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp critical (InitFFmmAlgorithmThread)
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThread)
{
this->kernels[idxThread] = new KernelClass(*inKernels);
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
......
......@@ -62,11 +62,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp critical (InitFFmmAlgorithmThreadBalance)
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadBalance)
{
this->kernels[idxThread] = new KernelClass(*inKernels);
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
......
......@@ -157,11 +157,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadProc)
{
this->kernels[idxThread] = new KernelClass(*inKernels);
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
......
......@@ -117,11 +117,11 @@ public:
void setKernel(KernelClass*const inKernels){
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadProcPeriodic)
{
this->kernels[idxThread] = new KernelClass(*inKernels);
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
}
......
......@@ -71,11 +71,11 @@ public:
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
#pragma omp critical (InitFFmmAlgorithmThreadTsm)
#pragma omp parallel num_threads(MaxThreads)
{
#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