artdaq  v3_10_01
transfer_driver.cc
1 #define TRACE_NAME "transfer_driver"
2 
3 #include "artdaq/DAQdata/Globals.hh"
4 #include "artdaq/DAQrate/TransferTest.hh"
5 #include "artdaq-utilities/Plugins/MakeParameterSet.hh"
6 
7 int main(int argc, char* argv[]) try
8 {
9  artdaq::configureMessageFacility("transfer_driver");
10  TLOG(TLVL_INFO) << "BEGIN";
11 
12  std::cout << "argc:" << argc << std::endl;
13  for (int i = 0; i < argc; ++i)
14  {
15  std::cout << "argv[" << i << "]: " << argv[i] << std::endl; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
16  }
17 
18  if (argc != 3)
19  {
20  std::cerr << *argv << " requires 2 arguments, " << argc - 1 << " provided" << std::endl;
21  std::cerr << "Usage: " << *argv << " <my_rank> <fhicl_document>" << std::endl;
22  return 1;
23  }
24 
25  std::string rankString(argv[1]); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
26  my_rank = std::stoi(rankString);
27 
28  cet::filepath_lookup lookup_policy("FHICL_FILE_PATH");
29 
30  auto fhicl = std::string(argv[2]); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
31  auto ps = artdaq::make_pset(fhicl, lookup_policy);
32 
33  if (ps.has_key("partition_number"))
34  {
35  artdaq::Globals::partition_number_ = ps.get<int>("partition_number");
36  }
37 
38  artdaq::TransferTest theTest(ps);
39  theTest.runTest();
40 
41  TLOG(TLVL_INFO) << "END";
42  return 0;
43 }
44 catch (...)
45 {
46  return -1;
47 }
Test a set of TransferInterface plugins.
Definition: TransferTest.hh:16
static int partition_number_
The partition number of the current application.
Definition: Globals.hh:39