2 #include <boost/program_options.hpp>
3 #include <boost/lexical_cast.hpp>
4 #include "artdaq/Application/TaskType.hh"
5 #include "artdaq/Application/RoutingMasterApp.hh"
6 #include "artdaq/Application/LoadParameterSet.hh"
7 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
8 #include "artdaq/Application/MPI2/MPISentry.hh"
10 #include "artdaq/BuildInfo/GetPackageBuildInfo.hh"
11 #include "cetlib_except/exception.h"
12 #include "artdaq/DAQdata/Globals.hh"
14 int main(
int argc,
char* argv[])
18 int const wanted_threading_level{ MPI_THREAD_FUNNELED };
20 MPI_Comm local_group_comm;
21 std::unique_ptr<artdaq::MPISentry> mpiSentry;
25 mpiSentry.reset(
new artdaq::MPISentry(&argc, &argv, wanted_threading_level, artdaq::TaskType::RoutingMasterTask, local_group_comm));
27 catch (cet::exception& errormsg)
29 TLOG_ERROR(
"RoutingMasterMain") << errormsg << TLOG_ENDL;
30 TLOG_ERROR(
"RoutingMasterMain") <<
"MPISentry error encountered in RoutingMasterMain; exiting..." << TLOG_ENDL;
34 fhicl::ParameterSet config_ps = LoadParameterSet(argc, argv);
35 app_name = config_ps.get<std::string>(
"application_name",
"RoutingMaster");
36 std::string mf_app_name = artdaq::setMsgFacAppName(app_name, config_ps.get<
int>(
"id"));
37 artdaq::configureMessageFacility(mf_app_name.c_str());
38 TLOG_DEBUG(app_name +
"Main") <<
"Setting application name to " << mf_app_name << TLOG_ENDL;
41 TLOG_INFO(app_name +
"Main") <<
"artdaq version " <<
50 TLOG_INFO(app_name +
"Main") <<
"Running Commmander Server" << TLOG_ENDL;
51 commander->run_server();
52 TLOG_INFO(app_name +
"Main") <<
"Commandable Server ended, exiting..." << TLOG_ENDL;
The MPISentry class initializes and finalizes the MPI context that the artdaq applciations run in...
int rank() const
Get the MPI rank of the application.
static artdaq::PackageBuildInfo getPackageBuildInfo()
Gets the version number and build timestmap for artdaq.
std::unique_ptr< artdaq::CommanderInterface > MakeCommanderPlugin(const fhicl::ParameterSet &commander_pset, artdaq::Commandable &commandable)
Load a CommanderInterface plugin.
RoutingMasterApp is an artdaq::Commandable derived class which controls the RoutingMasterCore state m...