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);
57 nThreads = threadsInfo.nThreads_;
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);
std::vector< std::string > defaultCmsRunServices()
void setThreadOptions(ThreadsInfo const &threadsInfo, edm::ParameterSet &pset)
static PluginManager & configure(const Config &)
edm::EventProcessor processor_
unsigned int setNThreads(unsigned int iNThreads, unsigned int iStackSize, std::unique_ptr< ThreadsController > &oPtr)
PythonEventProcessor(PyBind11ProcessDesc const &)
PluginManager::Config config()
StatusCode runToCompletion()
static ServiceToken createContaining(std::unique_ptr< T > iService)
create a service token that holds the service defined by iService
ThreadsInfo threadOptions(edm::ParameterSet const &pset)