1 #include "otsdaq-core/MPICore/MPIInitializer.h"
3 #include "otsdaq-core/MessageFacility/MessageFacility.h"
4 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
5 #include "artdaq/BuildInfo/GetPackageBuildInfo.hh"
6 #include "fhiclcpp/make_ParameterSet.h"
16 MPIInitializer::MPIInitializer(
void)
17 : local_group_comm_(0), rank_(0)
22 void MPIInitializer::init(std::string name, artdaq::TaskType taskType)
25 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
"BEGIN" << std::endl;
27 INIT_MF((name +
"App").c_str());
31 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
"MF initialized" << std::endl;
35 int const wanted_threading_level { MPI_THREAD_MULTIPLE };
49 mpiSentry_.reset(
new artdaq::MPISentry(0, 0, wanted_threading_level, taskType, local_group_comm_) );
51 catch (cet::exception& errormsg)
53 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
"DIDN't FIND MPI!" << std::endl;
57 mf::LogError(name) << errormsg ;
58 mf::LogError(name) <<
"MPISentry error encountered in " << name <<
"; exiting...";
62 rank_ = mpiSentry_->rank();
64 unsigned short port = 5100;
67 mf::LogDebug(name +
"InterfaceManager") <<
"artdaq version " <<
68 artdaq::GetPackageBuildInfo::getPackageBuildInfo().getPackageVersion()
70 artdaq::GetPackageBuildInfo::getPackageBuildInfo().getBuildTimestamp();
74 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
"END" << std::endl;
78 MPIInitializer::~MPIInitializer(
void)
80 mpiSentry_.reset(
nullptr);