1 #include "artdaq/DAQdata/Globals.hh"
2 #include "artdaq/Application/TaskType.hh"
3 #include "artdaq/Application/BoardReaderApp.hh"
4 #include "artdaq/Application/MPI2/MPISentry.hh"
6 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
7 #include "artdaq/Application/LoadParameterSet.hh"
8 #include "artdaq/BuildInfo/GetPackageBuildInfo.hh"
9 #include "cetlib_except/exception.h"
11 #include <boost/program_options.hpp>
12 #include <boost/lexical_cast.hpp>
17 int main(
int argc,
char* argv[])
21 int const wanted_threading_level{ MPI_THREAD_FUNNELED };
23 MPI_Comm local_group_comm;
24 std::unique_ptr<artdaq::MPISentry> mpiSentry;
28 mpiSentry.reset(
new artdaq::MPISentry(&argc, &argv, wanted_threading_level, artdaq::TaskType::BoardReaderTask, local_group_comm));
30 catch (cet::exception& errormsg)
32 TLOG_ERROR(
"BoardReaderMain") << errormsg << TLOG_ENDL;
33 TLOG_ERROR(
"BoardReaderMain") <<
"MPISentry error encountered in BoardReaderMain; exiting..." << TLOG_ENDL;
37 fhicl::ParameterSet config_ps = LoadParameterSet(argc, argv);
38 app_name = config_ps.get<std::string>(
"application_name",
"BoardReader");
39 std::string mf_app_name = artdaq::setMsgFacAppName(app_name, config_ps.get<
int>(
"id"));
40 artdaq::configureMessageFacility(mf_app_name.c_str());
41 TLOG_DEBUG(app_name +
"Main") <<
"Setting application name to " << mf_app_name << TLOG_ENDL;
44 TLOG_INFO(app_name +
"Main") <<
"artdaq version " <<
53 TLOG_INFO(app_name +
"Main") <<
"Running Commmander Server" << TLOG_ENDL;
54 commander->run_server();
55 TLOG_INFO(app_name +
"Main") <<
"Commandable Server ended, exiting..." << TLOG_ENDL;
BoardReaderApp is an artdaq::Commandable derived class which controls the BoardReaderCore state machi...
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.