1 #define TRACE_NAME "ArtdaqGlobalsService"
6 #include "art/Framework/Services/Registry/ServiceHandle.h"
7 #include "artdaq-core/Utilities/ExceptionHandler.hh"
8 #include "artdaq/ArtModules/ArtdaqGlobalsService.h"
10 #include "artdaq/DAQdata/Globals.hh"
12 #define build_key(seed) ((seed) + ((GetPartitionNumber() + 1) << 16) + (getppid() & 0xFFFF))
14 static fhicl::ParameterSet empty_pset;
18 TLOG(TLVL_DEBUG + 33) <<
"ArtdaqGlobalsService CONSTRUCTOR";
20 char const* artapp_env = getenv(
"ARTDAQ_APPLICATION_NAME");
21 std::string artapp_str;
22 if (artapp_env !=
nullptr)
24 artapp_str = std::string(artapp_env) +
"_";
27 TLOG(TLVL_DEBUG + 33) <<
"Setting app_name";
29 artapp_env = getenv(
"ARTDAQ_RANK");
30 if (artapp_env !=
nullptr && my_rank < 0)
32 TLOG(TLVL_DEBUG + 33) <<
"Setting rank from envrionment";
33 my_rank = strtol(artapp_env,
nullptr, 10);
34 app_name = artapp_str +
"art" + std::string(artapp_env);
38 TLOG(TLVL_DEBUG + 33) <<
"Setting default rank and name";
40 app_name = artapp_str +
"art";
47 metricMan->initialize(pset.get<fhicl::ParameterSet>(
"metrics", fhicl::ParameterSet()), app_name);
48 metricMan->do_start();
53 artdaq::ExceptionHandler(artdaq::ExceptionHandlerRethrow::no,
"Error loading metrics in ArtdaqGlobalsService()");
56 TLOG(TLVL_INFO) <<
"app_name is " << app_name <<
", rank " << my_rank;
Interface for ArtdaqSharedMemoryService. This interface is declared to art as part of the required re...
virtual ~ArtdaqGlobalsService()
ArtdaqGlobalsService Destructor. Calls disconnect().
static void CleanUpGlobals()
Clean up statically-allocated Manager class instances.
ArtdaqGlobalsService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
ArtdaqGlobalsService Constructor.
ArtdaqGlobalsService extends ArtdaqSharedMemoryServiceInterface. It manages the artdaq Global varaibl...