mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-30 15:34:01 +03:00
go back to using sysconf() for linux/osx. Runs ok on new systems but not thor. std:🧵:hardware_concurrency() returns 0 on thor
This commit is contained in:
parent
54c2eae4b4
commit
d7b67e3cd2
@ -42,8 +42,13 @@ ThreadPool::ThreadPool(size_t numThreads, int cpuAffinityOffset,
|
||||
int cpuAffinityIncr) :
|
||||
m_stopped(false), m_stopping(false), m_queueLimit(0)
|
||||
{
|
||||
//size_t numCPU = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
size_t numCPU = std::thread::hardware_concurrency();
|
||||
#else
|
||||
size_t numCPU = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#endif
|
||||
//cerr << "numCPU=" << numCPU << endl;
|
||||
|
||||
int cpuInd = cpuAffinityOffset % numCPU;
|
||||
|
||||
for (size_t i = 0; i < numThreads; ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user