336 ModulesByThreadingType modules{};
337 vector<string> configErrMsgs;
338 for (
auto const& [module_label, mci] :
allModules_) {
339 auto const& modPS = mci.modPS;
340 auto const&
md = mci.modDescription;
342 auto const module_threading_type =
md.moduleThreadingType();
349 if (
auto err_msg = get_if<std::string>(&mod)) {
350 configErrMsgs.push_back(*err_msg);
354 assert(std::holds_alternative<ModuleBase*>(mod));
355 auto module = std::get<ModuleBase*>(mod);
359 modules.shared.emplace(module_label,
360 std::shared_ptr<ModuleBase>{
module});
362 PerScheduleContainer<std::shared_ptr<ModuleBase>> replicated_modules(
364 replicated_modules[sid].reset(
module);
365 ScheduleIteration schedule_iteration{sid.next(),
366 ScheduleID(nschedules)};
368 auto fill_replicated_module = [&,
this](ScheduleID
const sid) {
370 if (
auto mod_ptr = get_if<ModuleBase*>(&repl_mod)) {
371 replicated_modules[sid].reset(*mod_ptr);
374 schedule_iteration.for_each_schedule(fill_replicated_module);
375 modules.replicated.emplace(module_label, replicated_modules);
387 module->getConsumables());
390 if (!configErrMsgs.empty()) {
394 << rule(
'=') <<
"\n\n" 395 <<
"!! The following modules have been misconfigured: !!" 397 for (
auto const&
err : configErrMsgs) {
398 msg <<
"\n" << rule(
'-') <<
"\n" <<
err;
400 msg <<
"\n" << rule(
'=') <<
"\n\n";
void collectConsumes(std::string const &module_label, consumables_t::mapped_type const &consumables)
static ConsumesInfo * instance()
void msg(const char *fmt,...)
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleConstruction
static constexpr ScheduleID first()
ModuleType module_type(std::string const &full_key)
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleConstruction
maybe_module_t makeModule_(fhicl::ParameterSet const &module_pset, ModuleDescription const &md, ScheduleID) const
std::map< std::string, detail::ModuleConfigInfo > allModules_
void err(const char *fmt,...)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
ActivityRegistry const & actReg_