artdaq  v3_09_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 "fhiclcpp/make_ParameterSet.h"
6 
7 int main(int argc, char* argv[])
8 try
9 {
10  artdaq::configureMessageFacility("transfer_driver");
11  TLOG(TLVL_INFO) << "BEGIN";
12 
13  std::cout << "argc:" << argc << std::endl;
14  for (int i = 0; i < argc; ++i)
15  {
16  std::cout << "argv[" << i << "]: " << argv[i] << std::endl; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
17  }
18 
19  if (argc != 3)
20  {
21  std::cerr << *argv << " requires 2 arguments, " << argc - 1 << " provided" << std::endl;
22  std::cerr << "Usage: " << *argv << " <my_rank> <fhicl_document>" << std::endl;
23  return 1;
24  }
25 
26  std::string rankString(argv[1]); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
27  my_rank = std::stoi(rankString);
28 
29  cet::filepath_lookup lookup_policy("FHICL_FILE_PATH");
30  fhicl::ParameterSet ps;
31 
32  auto fhicl = std::string(argv[2]); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
33  make_ParameterSet(fhicl, lookup_policy, ps);
34 
35  if (ps.has_key("partition_number"))
36  {
37  artdaq::Globals::partition_number_ = ps.get<int>("partition_number");
38  }
39 
40  artdaq::TransferTest theTest(ps);
41  theTest.runTest();
42 
43  TLOG(TLVL_INFO) << "END";
44  return 0;
45 }
46 catch (...)
47 {
48  return -1;
49 }
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