CMS 3D CMS Logo

path_configuration.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Utilities
4 // namespace : path_configuration
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Christopher Jones
10 // Created: Wed, 30 Mar 2022 15:04:35 GMT
11 //
12 
13 // system include files
14 #include <algorithm>
15 #include <array>
16 
17 // user include files
19 
20 namespace edm::path_configuration {
21 
23  static const SchedulingConstructLabelSet s_set({{"@"}, {"#"}});
24  return s_set;
25  }
26 
27  //Takes the Parameter associated to a given Path and converts it to the list of modules
28  // in the same order as the Path's position bits
29  std::vector<std::string> configurationToModuleBitPosition(std::vector<std::string> iConfig) {
30  auto const& labelsToRemove = schedulingConstructLabels();
31  iConfig.erase(
32  std::remove_if(iConfig.begin(),
33  iConfig.end(),
34  [&labelsToRemove](auto const& n) { return labelsToRemove.find(n) != labelsToRemove.end(); }),
35  iConfig.end());
36  return iConfig;
37  }
38 
40  constexpr std::array<char, 4> s_tokens = {{'!', '-', '+', '|'}};
41  if (not iLabel.empty()) {
42  for (auto t : s_tokens) {
43  if (t == iLabel[0]) {
44  iLabel.erase(0, 1);
45  break;
46  }
47  }
48  }
49  return iLabel;
50  }
51 
52 } // namespace edm::path_configuration
std::string removeSchedulingTokensFromModuleLabel(std::string iLabel)
std::vector< std::string > configurationToModuleBitPosition(std::vector< std::string >)
SchedulingConstructLabelSet const & schedulingConstructLabels()
std::unordered_set< std::string, std::hash< std::string >, std::equal_to<> > SchedulingConstructLabelSet
The label is an indicator of a path scheduling construct and not an actual module.