Skip to content

Commit d2466cb

Browse files
committed
Limited IMPL threads to number of cores
1 parent af8c984 commit d2466cb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Init.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,17 @@ void STDCALL SetResources(
111111
// The number of threads will be limited by:
112112
// - If threading set as single-threaded or compiled only
113113
// single-threaded: 1
114-
// - If threading set as one of the IMPL variants: 1.5 * ncores
114+
// - If threading set as one of the IMPL variants: ncores
115115
// whatever the user says (as we currently don't have control)
116-
// - Otherwise the lower of maxThreads and 1.5 * ncores (for test
117-
// purpose, later one 1 * ncores)
116+
// - Otherwise the lower of maxThreads and ncores
118117

119118
int thrMax;
120119
if (sysdep.IsSingleThreaded())
121120
thrMax = 1;
122121
else if (sysdep.IsIMPL() || maxThreadsIn <= 0)
123-
thrMax = static_cast<int>(1.51 * ncores);
122+
thrMax = ncores;
124123
else
125-
thrMax = min(maxThreadsIn, static_cast<int>(1.51 * ncores));
124+
thrMax = min(maxThreadsIn, ncores);
126125

127126
// For simplicity we won't vary the amount of memory per thread
128127
// in the small and large versions.

0 commit comments

Comments
 (0)