00001 #include "artdaq/Application/Commandable.hh"
00002 #include "artdaq/Application/MPI2/MPISentry.hh"
00003 #include "artdaq-core/Utilities/configureMessageFacility.hh"
00004 #include "artdaq/DAQrate/quiet_mpi.hh"
00005 #include "artdaq/DAQdata/Globals.hh"
00006 #include "artdaq/ExternalComms/MakeCommanderPlugin.hh"
00007 #include "artdaq/Application/LoadParameterSet.hh"
00008
00009 #include <boost/program_options.hpp>
00010 #include <boost/lexical_cast.hpp>
00011
00012 #include <iostream>
00013
00014 int main(int argc, char* argv[])
00015 {
00016
00017 int const wanted_threading_level{MPI_THREAD_FUNNELED};
00018 artdaq::MPISentry mpiSentry(&argc, &argv, wanted_threading_level);
00019 artdaq::configureMessageFacility("commandable");
00020 TLOG_DEBUG("Commandable::main")
00021 << "MPI initialized with requested thread support level of "
00022 << wanted_threading_level << ", actual support level = "
00023 << mpiSentry.threading_level() << "." << TLOG_ENDL;
00024 TLOG_DEBUG("Commandable::main")
00025 << "size = "
00026 << mpiSentry.procs()
00027 << ", rank = "
00028 << mpiSentry.rank() << TLOG_ENDL;
00029
00030
00031 fhicl::ParameterSet config = LoadParameterSet(argc, argv);
00032
00033
00034 artdaq::setMsgFacAppName("Commandable", config.get<int>("id"));
00035
00036
00037 artdaq::Commandable commandable;
00038
00039 auto commander = artdaq::MakeCommanderPlugin(config, commandable);
00040 commander->run_server();
00041 }