Commit fde2be14 authored by BRAMAS Berenger's avatar BRAMAS Berenger

Add critical when creating kernel for each thread to ensure that the thread...

Add critical when creating kernel for each thread to ensure that the thread are in a protected environment
parent dd7ae532
......@@ -66,7 +66,10 @@ public:
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass(*inKernels);
#pragma omp critical
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
FLOG(FLog::Controller << "FFmmAlgorithmSectionTask (Max Thread " << omp_get_max_threads() << ")\n");
......
......@@ -66,7 +66,10 @@ public:
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass(*inKernels);
#pragma omp critical
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
FLOG(FLog::Controller << "FFmmAlgorithmTask (Max Thread " << omp_get_max_threads() << ")\n");
......
......@@ -74,7 +74,10 @@ public:
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass(*inKernels);
#pragma omp critical
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
FLOG(FLog::Controller << "FFmmAlgorithmThread (Max Thread " << omp_get_max_threads() << ")\n");
......
......@@ -143,7 +143,10 @@ public:
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass(*inKernels);
#pragma omp critical
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
FLOG(FLog::Controller << "FFmmAlgorithmThreadProc\n");
......
......@@ -115,7 +115,10 @@ public:
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass(*inKernels);
#pragma omp critical
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
}
......
......@@ -70,7 +70,10 @@ public:
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for schedule(static)
for(int idxThread = 0 ; idxThread < MaxThreads ; ++idxThread){
this->kernels[idxThread] = new KernelClass(*inKernels);
#pragma omp critical
{
this->kernels[idxThread] = new KernelClass(*inKernels);
}
}
FLOG(FLog::Controller << "FFmmAlgorithmThreadTsm\n");
......
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