FWCore
Concurrency
src
setNThreads.cc
Go to the documentation of this file.
1
//
2
// setNThreads.cc
3
// CMSSW
4
//
5
// Created by Chris Jones on 7/24/20.
6
//
7
#include "tbb/task_arena.h"
8
#include "
FWCore/Concurrency/interface/setNThreads.h
"
9
10
namespace
edm
{
11
unsigned
int
setNThreads
(
unsigned
int
iNThreads,
unsigned
int
iStackSize, std::unique_ptr<ThreadsController>& oPtr) {
12
//stack size is given in KB but passed in as bytes
13
iStackSize *= 1024;
14
15
oPtr.reset();
16
if
(0 == iNThreads) {
17
//Allow TBB to decide how many threads. This is normally the number of CPUs in the machine.
18
iNThreads = tbb::this_task_arena::max_concurrency();
19
}
20
oPtr = std::make_unique<ThreadsController>(static_cast<int>(iNThreads), iStackSize);
21
22
return
iNThreads;
23
}
24
}
// namespace edm
edm
HLT enums.
Definition:
AlignableModifier.h:19
setNThreads.h
edm::setNThreads
unsigned int setNThreads(unsigned int iNThreads, unsigned int iStackSize, std::unique_ptr< ThreadsController > &oPtr)
Definition:
setNThreads.cc:11
Generated for CMSSW Reference Manual by
1.8.16