Remove thread count upper bound defined as the number of CPU cores.
#include <util/random/shuffle.h>
#include <util/system/compiler.h>
#include <util/system/hp_timer.h>
-#include <util/system/info.h>
using namespace NCB;
@@ -63,10 +62,6 @@ static void ShrinkModel(int itCount, const TCtrHelper& ctrsHelper, TLearnProgres
}
}
-static int GetThreadCount(const NCatboostOptions::TCatBoostOptions& options) {
- return Min<int>(options.SystemOptions->NumThreads, (int)NSystemInfo::CachedNumberOfCpus());
-}
-
static TDataProviders LoadPools(
const NCatboostOptions::TPoolLoadParams& loadOptions,
@@ -753,7 +748,7 @@ void TrainModel(
);
NPar::TLocalExecutor executor;
- executor.RunAdditionalThreads(GetThreadCount(catBoostOptions) - 1);
+ executor.RunAdditionalThreads(catBoostOptions.SystemOptions.Get().NumThreads.Get() - 1);
TDataProviders pools = LoadPools(
loadOptions,
@@ -904,7 +899,8 @@ void TrainModel(
outputOptions.Load(outputFilesOptionsJson);
NPar::TLocalExecutor executor;
- executor.RunAdditionalThreads(GetThreadCount(NCatboostOptions::LoadOptions(trainOptionsJson)) - 1);
+ executor.RunAdditionalThreads(
+ NCatboostOptions::LoadOptions(trainOptionsJson).SystemOptions.Get().NumThreads.Get() - 1);
TrainModel(
trainOptionsJson,
