15 #include "tbb/task_arena.h"
36 std::once_flag pluginFlag;
37 int setupPluginSystem() {
42 std::shared_ptr<edm::ProcessDesc> addDefaultServicesToProcessDesc(std::shared_ptr<edm::ProcessDesc> iDesc) {
51 std::shared_ptr<edm::ProcessDesc> setupThreading(std::shared_ptr<edm::ProcessDesc> iDesc) {
53 std::shared_ptr<edm::ParameterSet>
pset = iDesc->getProcessPSet();
56 threadsInfo.nThreads_ =
edm::setNThreads(threadsInfo.nThreads_, threadsInfo.stackSize_, tsiPtr);
68 std::make_unique<edm::JobReport>(
nullptr)));
84 : forcePluginSetupFirst_(setupPluginSystem()),
85 processor_(addDefaultServicesToProcessDesc(setupThreading(iDesc.processDesc())),
90 class TaskCleanupSentry {
93 ~TaskCleanupSentry() { ep_->taskCleanup(); }
101 auto gil = PyEval_SaveThread();
104 tbb::task_arena{
nThreads}.execute([
this]() {
110 PyEval_RestoreThread(gil);
114 auto gil = PyEval_SaveThread();
119 PyEval_RestoreThread(gil);