Skip to content

Commit

Permalink
Refs #10330. Threadpool respects MaxCores value from ConfigService
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed Oct 17, 2014
1 parent c389d08 commit ff63c45
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Code/Mantid/Framework/Kernel/src/ThreadPool.cpp
Expand Up @@ -4,6 +4,7 @@
#include "MantidKernel/ThreadPool.h"
#include "MantidKernel/ThreadPoolRunnable.h"
#include "MantidKernel/Task.h"
#include "MantidKernel/ConfigService.h"
#include <algorithm>
#include <sstream>
#include <cmath>
Expand Down Expand Up @@ -65,7 +66,12 @@ namespace Kernel
*/
size_t ThreadPool::getNumPhysicalCores()
{
return Poco::Environment::processorCount();
int maxCores(0);
int retVal = Kernel::ConfigService::Instance().getValue("MultiThreaded.MaxCores", maxCores);
if(retVal > 0 && maxCores > 0)
return maxCores;
else
return Poco::Environment::processorCount();
}

//--------------------------------------------------------------------------------
Expand Down

0 comments on commit ff63c45

Please sign in to comment.