artdaq  v3_00_01
StateResponder.cc
1 #include "artdaq/Application/Commandable.hh"
2 #include "artdaq/Application/MPI2/MPISentry.hh"
3 #include "artdaq-core/Utilities/configureMessageFacility.hh"
5 #include "artdaq/DAQdata/Globals.hh"
6 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
7 #include "artdaq/Application/LoadParameterSet.hh"
8 
9 #include <boost/program_options.hpp>
10 #include <boost/lexical_cast.hpp>
11 
12 #include <iostream>
13 
14 int main(int argc, char* argv[])
15 {
16  // initialization
17  int const wanted_threading_level{MPI_THREAD_FUNNELED};
18  artdaq::MPISentry mpiSentry(&argc, &argv, wanted_threading_level);
19  artdaq::configureMessageFacility("commandable");
20  TLOG_DEBUG("Commandable::main")
21  << "MPI initialized with requested thread support level of "
22  << wanted_threading_level << ", actual support level = "
23  << mpiSentry.threading_level() << "." << TLOG_ENDL;
24  TLOG_DEBUG("Commandable::main")
25  << "size = "
26  << mpiSentry.procs()
27  << ", rank = "
28  << mpiSentry.rank() << TLOG_ENDL;
29 
30 
31  fhicl::ParameterSet config = LoadParameterSet(argc, argv);
32 
33 
34  artdaq::setMsgFacAppName("Commandable", config.get<int>("id"));
35 
36  // create the Commandable object
37  artdaq::Commandable commandable;
38 
39  auto commander = artdaq::MakeCommanderPlugin(config, commandable);
40  commander->run_server();
41 }
Commandable is the base class for all artdaq components which implement the artdaq state machine...
Definition: Commandable.hh:20
The MPISentry class initializes and finalizes the MPI context that the artdaq applciations run in...
Definition: MPISentry.hh:15
std::unique_ptr< artdaq::CommanderInterface > MakeCommanderPlugin(const fhicl::ParameterSet &commander_pset, artdaq::Commandable &commandable)
Load a CommanderInterface plugin.