Commit dbc5d8bb authored by ESTERIE Pierre's avatar ESTERIE Pierre

Changing omp_get_max_threads to omp_get_num_threads()

parent 7ae6b807
......@@ -48,7 +48,7 @@ class FFmmAlgorithmNewTask : public FAbstractAlgorithm, public FAlgorithmTimers
OctreeClass* const tree; //< The octree to work on
KernelClass** kernels; //< The kernels
const int MaxThreads;
int MaxThreads;
const int OctreeHeight;
......@@ -59,15 +59,20 @@ public:
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FFmmAlgorithmNewTask(OctreeClass* const inTree, KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
FFmmAlgorithmNewTask(OctreeClass* const inTree, const KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())), OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria)
OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria)
{
FAssertLF(tree, "tree cannot be null");
FAssertLF(inKernels, "kernels cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
......@@ -79,7 +84,7 @@ public:
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
FLOG(FLog::Controller << "FFmmAlgorithmNewTask (Max Thread " << omp_get_max_threads() << ")\n");
FLOG(FLog::Controller << "FFmmAlgorithmNewTask (Max Thread " << omp_get_num_threads() << ")\n");
}
/** Default destructor */
......@@ -100,7 +105,7 @@ public:
{
#pragma omp single nowait
{
threads = omp_get_max_threads();
threads = omp_get_num_threads();
}
}
return std::string("threads: ") + std::to_string(threads);
......
......@@ -105,7 +105,7 @@ class FFmmAlgorithmOmp4 : public FAbstractAlgorithm, public FAlgorithmTimers {
OctreeClass* const tree; //< The octree to work on
KernelClass** kernels; //< The kernels
const int MaxThreads;
int MaxThreads;
const int OctreeHeight;
......@@ -120,16 +120,21 @@ public:
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FFmmAlgorithmOmp4(OctreeClass* const inTree, KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())), OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria),
FFmmAlgorithmOmp4(OctreeClass* const inTree, const KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr),
OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria),
p2pPrioCriteria(0)
{
{
FAssertLF(tree, "tree cannot be null");
FAssertLF(inKernels, "kernels cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
......@@ -141,7 +146,7 @@ public:
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
FLOG(FLog::Controller << "FFmmAlgorithmOmp4 (Max Thread " << omp_get_max_threads() << ")\n");
FLOG(FLog::Controller << "FFmmAlgorithmOmp4 (Max Thread " << omp_get_num_threads() << ")\n");
FAssertLF(KernelClass::NeedFinishedM2LEvent() == false, "FFmmAlgorithmOmp4 cannot notify for M2L at level ending.");
......@@ -179,7 +184,7 @@ public:
{
#pragma omp single nowait
{
threads = omp_get_max_threads();
threads = omp_get_num_threads();
}
}
return std::string("threads: ") + std::to_string(threads);
......
......@@ -52,7 +52,7 @@ class FFmmAlgorithmSectionTask : public FAbstractAlgorithm, public FAlgorithmTim
OctreeClass* const tree; ///< The octree to work on
KernelClass** kernels; ///< The kernels
const int MaxThreads;
int MaxThreads;
const int OctreeHeight;
......@@ -65,11 +65,10 @@ public:
* \param inKernels the kernels used for computation.
*/
FFmmAlgorithmSectionTask(OctreeClass* const inTree,
KernelClass* const inKernels,
const KernelClass* const inKernels,
const int inLeafLevelSeparationCriteria = 1) :
tree(inTree) ,
kernels(0),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())),
kernels(nullptr),
OctreeHeight(tree->getHeight()),
leafLevelSeparationCriteria(inLeafLevelSeparationCriteria) {
......@@ -77,6 +76,11 @@ public:
FAssertLF(inKernels, "kernels cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
......@@ -88,7 +92,7 @@ public:
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
FLOG(FLog::Controller << "FFmmAlgorithmSectionTask (Max Thread " << omp_get_max_threads() << ")\n");
FLOG(FLog::Controller << "FFmmAlgorithmSectionTask (Max Thread " << omp_get_num_threads() << ")\n");
}
/** Default destructor */
......@@ -109,7 +113,7 @@ public:
{
#pragma omp single nowait
{
threads = omp_get_max_threads();
threads = omp_get_num_threads();
}
}
return std::string("threads: ") + std::to_string(threads);
......
......@@ -46,7 +46,7 @@ class FFmmAlgorithmTask : public FAbstractAlgorithm, public FAlgorithmTimers {
OctreeClass* const tree; //< The octree to work on
KernelClass** kernels; //< The kernels
const int MaxThreads;
int MaxThreads;
const int OctreeHeight;
......@@ -57,15 +57,20 @@ public:
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FFmmAlgorithmTask(OctreeClass* const inTree, KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())), OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria)
FFmmAlgorithmTask(OctreeClass* const inTree, const KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr),
OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria)
{
FAssertLF(tree, "tree cannot be null");
FAssertLF(inKernels, "kernels cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
......@@ -77,7 +82,7 @@ public:
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
FLOG(FLog::Controller << "FFmmAlgorithmTask (Max Thread " << omp_get_max_threads() << ")\n");
FLOG(FLog::Controller << "FFmmAlgorithmTask (Max Thread " << omp_get_num_threads() << ")\n");
}
/** Default destructor */
......@@ -98,7 +103,7 @@ public:
{
#pragma omp single nowait
{
threads = omp_get_max_threads();
threads = omp_get_num_threads();
}
}
return std::string("threads: ") + std::to_string(threads);
......
......@@ -70,29 +70,26 @@ public:
*
* \except An exception is thrown if one of the arguments is NULL.
*/
FFmmAlgorithmThread(OctreeClass* const inTree, KernelClass* const inKernels,
FFmmAlgorithmThread(OctreeClass* const inTree, const KernelClass* const inKernels,
const int inUserChunkSize = 10, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr), iterArray(nullptr), leafsNumber(0),
: tree(inTree), kernels(nullptr), iterArray(nullptr), leafsNumber(0),
OctreeHeight(tree->getHeight()),
userChunkSize(inUserChunkSize), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria) {
FAssertLF(tree, "tree cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
FAssertLF(0 < userChunkSize, "Chunk size should be > 0");
#pragma omp parallel shared(MaxThreads)
{
#pragma omp single nowait
{
MaxThreads = omp_get_num_threads();
}
}
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel for shared(kernels)
for(int i = 0; i < omp_get_num_threads(); ++i) {
if(i == omp_get_thread_num()) {
this->kernels[i] = new KernelClass(*inKernels);
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThread)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
......@@ -101,7 +98,7 @@ public:
for(int idxShape = 0 ; idxShape < SizeShape ; ++idxShape){
this->shapeLeaf[idxShape] = 0;
}
FLOG(FLog::Controller << "FFmmAlgorithmThread (Max Thread " << omp_get_max_threads() << ")\n");
FLOG(FLog::Controller << "FFmmAlgorithmThread (Max Thread " << omp_get_num_threads() << ")\n");
FLOG(FLog::Controller << "\t static schedule " << (userChunkSize == -1 ? "static" : (userChunkSize == 0 ? "N/p^2" : std::to_string(userChunkSize))) << ")\n");
}
......@@ -132,9 +129,9 @@ public:
template <class NumType>
NumType getChunkSize(const NumType inSize) const {
if(userChunkSize <= -1){
return FMath::Max(NumType(1) , NumType(double(inSize)/double(omp_get_max_threads())) );
return FMath::Max(NumType(1) , NumType(double(inSize)/double(omp_get_num_threads())) );
} else if(userChunkSize == 0){
return FMath::Max(NumType(1) , inSize/NumType(omp_get_max_threads()*omp_get_max_threads()));
return FMath::Max(NumType(1) , inSize/NumType(omp_get_num_threads()*omp_get_num_threads()));
} else {
return userChunkSize;
}
......@@ -166,6 +163,7 @@ protected:
} while(octreeIterator.moveRight());
iterArray = new typename OctreeClass::Iterator[leafsNumber];
FAssertLF(iterArray, "iterArray bad alloc");
Timers[P2MTimer].tic();
......
......@@ -46,7 +46,7 @@ class FFmmAlgorithmThreadBalance : public FAbstractAlgorithm, public FAlgorithmT
static const int SizeShape = P2PExclusionClass::SizeShape;
const int MaxThreads; ///< The maximum number of threads.
int MaxThreads; ///< The maximum number of threads.
const int OctreeHeight; ///< The height of the given tree.
......@@ -63,14 +63,20 @@ public:
*
* \except An exception is thrown if one of the arguments is NULL.
*/
FFmmAlgorithmThreadBalance(OctreeClass* const inTree, KernelClass* const inKernels,
FFmmAlgorithmThreadBalance(OctreeClass* const inTree, const KernelClass* const inKernels,
const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())), OctreeHeight(tree->getHeight()),
leafLevelSeparationCriteria(inLeafLevelSeperationCriteria) {
OctreeHeight(tree->getHeight()),
leafLevelSeparationCriteria(inLeafLevelSeperationCriteria)
{
FAssertLF(tree, "tree cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
......@@ -83,7 +89,7 @@ public:
FAbstractAlgorithm::setNbLevelsInTree(OctreeHeight);
buildThreadIntervals();
FLOG(FLog::Controller << "FFmmAlgorithmThreadBalance (Max Thread " << omp_get_max_threads() << ")\n");
FLOG(FLog::Controller << "FFmmAlgorithmThreadBalance (Max Thread " << omp_get_num_threads() << ")\n");
}
/** Default destructor */
......
......@@ -79,9 +79,9 @@ private:
FMpi::FComm fcomCompute;
int numberOfLeafs; ///< To store the size at the previous level
const int MaxThreads; ///< Max number of thread allowed by openmp
int nbProcess; ///< Process count
int idProcess; ///< Current process id
int MaxThreads; ///< Max number of thread allowed by openmp
int nbProcess; ///< Process count
int idProcess; ///< Current process id
const int nbProcessOrig; ///< Process count
const int idProcessOrig; ///< Current process id
......@@ -171,15 +171,15 @@ public:
/// \param inKernels a pointer on the computational kernel used in the algorithm
///
/// @todo move it in private section
void setKernel(KernelClass*const inKernels){
this->kernels = new KernelClass*[MaxThreads]{};
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadProcPeriodic)
void setKernel(const KernelClass*const inKernels){
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
#pragma omp critical (InitFFmmAlgorithmThreadProc)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
}
}
///
/// \brief getPtrOnMortonIndexAtLeaf
......@@ -214,7 +214,6 @@ public:
comm(inComm),
fcomCompute(inComm),
numberOfLeafs(0),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())),
nbProcess(0),
idProcess(0),
nbProcessOrig(inComm.processCount()),
......@@ -226,15 +225,12 @@ public:
FAssertLF(tree, "tree cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
// this->setKernel(inKernels) ;
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadProc)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
setKernel(inKernels);
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
......
......@@ -79,7 +79,7 @@ class FFmmAlgorithmThreadProcPeriodic : public FAbstractAlgorithm, public FAlgor
const FMpi::FComm& comm; ///< MPI communicator
int numberOfLeafs; ///< To store the size at the previous level
const int MaxThreads; ///< Max number of thread allowed by openmp
int MaxThreads; ///< Max number of thread allowed by openmp
const int nbProcess; ///< Process count
const int idProcess; ///< Current process id
......@@ -153,11 +153,11 @@ public:
///
/// @todo move it in private section --> warning we need to extend the box
///
void setKernel(KernelClass*const inKernels){
this->kernels = new KernelClass*[MaxThreads]{};
#pragma omp parallel num_threads(MaxThreads)
void setKernel(const KernelClass*const inKernels){
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadProcPeriodic)
#pragma omp critical (InitFFmmAlgorithmThreadProcPeriodic)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
......@@ -198,12 +198,12 @@ public:
leafLevelSeparationCriteria(inLeafLevelSeperationCriteria),
comm(inComm),
numberOfLeafs(0),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())),
nbProcess(inComm.processCount()),
idProcess(inComm.processId()),
userChunkSize(inUserChunkSize),
intervals(new Interval[inComm.processCount()]),
workingIntervalsPerLevel(new Interval[inComm.processCount() * tree->getHeight()]) {
workingIntervalsPerLevel(new Interval[inComm.processCount() * tree->getHeight()])
{
FAssertLF(tree, "tree cannot be null");
FAssertLF(-1 <= inUpperLevel, "inUpperLevel cannot be < -1");
......@@ -212,6 +212,11 @@ public:
FAbstractAlgorithm::setNbLevelsInTree(extendedTreeHeight());
rootCellFromProc.setLevel(offsetRealTree);
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
FLOG(FLog::Controller << "FFmmAlgorithmThreadProcPeriodic\n");
FLOG(FLog::Controller << "Max threads = " << MaxThreads << ", Procs = " << nbProcess << ", I am " << idProcess << ".\n");
FLOG(FLog::Controller << "Chunck Size = " << userChunkSize << "\n");
......@@ -1602,7 +1607,7 @@ protected:
}
const int limite = 1 << (this->OctreeHeight - 1); // the number of cell in a 1d direction
int alreadySent[nbProcess]{};
int alreadySent[nbProcess];
//Will store the indexes of the neighbors of current cell
MortonIndex indexesNeighbors[26];
......
......@@ -84,7 +84,7 @@ private:
typename OctreeClass::Iterator* iterArrayComm;
int numberOfLeafs; ///< To store the size at the previous level
const int MaxThreads; ///< Max number of thread allowed by openmp
int MaxThreads; ///< Max number of thread allowed by openmp
const int nbProcessOrig; ///< Process count
const int idProcessOrig; ///< Current process id
int nbProcess; ///< Process count
......@@ -150,7 +150,7 @@ public:
* An assert is launched if one of the arguments is null
*/
FFmmAlgorithmThreadProcTsm(const FMpi::FComm& inComm, OctreeClass* const inTree,
KernelClass* const inKernels,
const KernelClass* const inKernels,
const int inUserChunkSize = 10, const int inLeafLevelSeperationCriteria = 1) :
tree(inTree),
kernels(nullptr),
......@@ -159,7 +159,6 @@ public:
iterArray(nullptr),
iterArrayComm(nullptr),
numberOfLeafs(0),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())),
nbProcessOrig(inComm.processCount()),
idProcessOrig(inComm.processId()),
nbProcess(0),
......@@ -172,13 +171,18 @@ public:
FAssertLF(tree, "tree cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmThreadProcTsm)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
#pragma omp critical (InitFFmmAlgorithmThreadProcTsm)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
......
......@@ -45,7 +45,7 @@ class FFmmAlgorithmThreadTsm : public FAbstractAlgorithm, public FAlgorithmTimer
typename OctreeClass::Iterator* iterArray;
const int MaxThreads;
int MaxThreads;
const int OctreeHeight;
......@@ -57,20 +57,25 @@ public:
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FFmmAlgorithmThreadTsm(OctreeClass* const inTree, KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
FFmmAlgorithmThreadTsm(OctreeClass* const inTree, const KernelClass* const inKernels, const int inLeafLevelSeperationCriteria = 1)
: tree(inTree) , kernels(nullptr), iterArray(nullptr),
MaxThreads(FEnv::GetValue("SCALFMM_ALGO_NUM_THREADS",omp_get_max_threads())) , OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria) {
OctreeHeight(tree->getHeight()), leafLevelSeparationCriteria(inLeafLevelSeperationCriteria) {
FAssertLF(tree, "tree cannot be null");
FAssertLF(leafLevelSeparationCriteria < 3, "Separation criteria should be < 3");
MaxThreads = 1;
#pragma omp parallel
#pragma omp master
MaxThreads = omp_get_num_threads();
this->kernels = new KernelClass*[MaxThreads];
#pragma omp parallel num_threads(MaxThreads)
#pragma omp parallel num_threads(MaxThreads)
{
#pragma omp critical (InitFFmmAlgorithmTsm)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
#pragma omp critical (InitFFmmAlgorithmTsm)
{
this->kernels[omp_get_thread_num()] = new KernelClass(*inKernels);
}
}
FAbstractAlgorithm::setNbLevelsInTree(tree->getHeight());
......@@ -132,7 +137,7 @@ protected:
++numberOfLeafs;
} while(octreeIterator.moveRight());
const int chunkSize = FMath::Max(1 , numberOfLeafs/(omp_get_max_threads()*omp_get_max_threads()));
const int chunkSize = FMath::Max(1 , numberOfLeafs/(omp_get_num_threads()*omp_get_num_threads()));
FLOG(FTic computationCounter);
#pragma omp parallel num_threads(MaxThreads)
......@@ -192,7 +197,7 @@ protected:
avoidGotoLeftIterator.moveUp();
octreeIterator = avoidGotoLeftIterator;// equal octreeIterator.moveUp(); octreeIterator.gotoLeft();
const int chunkSize = FMath::Max(1 , numberOfCells/(omp_get_max_threads()*omp_get_max_threads()));
const int chunkSize = FMath::Max(1 , numberOfCells/(omp_get_num_threads()*omp_get_num_threads()));
FLOG(computationCounter.tic());
#pragma omp parallel num_threads(MaxThreads)
......@@ -281,7 +286,7 @@ protected:
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
const int chunkSize = FMath::Max(1 , numberOfCells/(omp_get_max_threads()*omp_get_max_threads()));
const int chunkSize = FMath::Max(1 , numberOfCells/(omp_get_num_threads()*omp_get_num_threads()));
FLOG(computationCounter.tic());
#pragma omp parallel num_threads(MaxThreads)
......@@ -378,7 +383,7 @@ protected:
avoidGotoLeftIterator.moveDown();
octreeIterator = avoidGotoLeftIterator;
const int chunkSize = FMath::Max(1 , numberOfCells/(omp_get_max_threads()*omp_get_max_threads()));
const int chunkSize = FMath::Max(1 , numberOfCells/(omp_get_num_threads()*omp_get_num_threads()));
FLOG(computationCounter.tic());
#pragma omp parallel num_threads(MaxThreads)
......@@ -444,7 +449,7 @@ protected:
} while(octreeIterator.moveRight());
}
const int chunkSize = FMath::Max(1 , numberOfLeafs/(omp_get_max_threads()*omp_get_max_threads()));
const int chunkSize = FMath::Max(1 , numberOfLeafs/(omp_get_num_threads()*omp_get_num_threads()));
const int heightMinusOne = OctreeHeight - 1;
FLOG(FTic computationCounter);
......
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