CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
WorkerManager.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_WorkerManager_h
2 #define FWCore_Framework_WorkerManager_h
3 
4 /*
5 
6 */
7 
19 
20 #include <memory>
21 
22 #include <set>
23 #include <string>
24 #include <vector>
25 
26 namespace edm {
27  class EventTransitionInfo;
28  class ExceptionCollector;
29  class StreamID;
30  class StreamContext;
31  class ModuleRegistry;
32  class PreallocationConfiguration;
33  namespace eventsetup {
35  }
36  class WorkerManager {
37  public:
38  typedef std::vector<Worker*> AllWorkers;
39 
40  WorkerManager(std::shared_ptr<ActivityRegistry> actReg, ExceptionToActionTable const& actions);
41  WorkerManager(WorkerManager&&) = default;
42 
43  WorkerManager(std::shared_ptr<ModuleRegistry> modReg,
44  std::shared_ptr<ActivityRegistry> actReg,
46 
47  void deleteModuleIfExists(std::string const& moduleLabel);
48 
52  std::shared_ptr<ProcessConfiguration> processConfiguration,
54  std::set<std::string>& unscheduledLabels,
55  std::vector<std::string>& shouldBeUsedLabels);
56 
57  template <typename T, typename U>
59  typename T::TransitionInfoType&,
60  ServiceToken const&,
61  StreamID,
62  typename T::Context const* topContext,
63  U const* context);
64 
65  template <typename T>
67  typename T::TransitionInfoType const&,
68  ServiceToken const&,
69  StreamID,
70  ParentContext const&,
71  typename T::Context const*);
72 
73  void setupResolvers(Principal& principal);
75 
76  void beginJob(ProductRegistry const& iRegistry,
78  ProcessBlockHelperBase const&);
79  void endJob();
80  void endJob(ExceptionCollector& collector);
81 
82  void beginStream(StreamID iID, StreamContext& streamContext);
83  void endStream(StreamID iID, StreamContext& streamContext);
84 
85  AllWorkers const& allWorkers() const { return allWorkers_; }
86 
87  void addToAllWorkers(Worker* w);
88 
89  ExceptionToActionTable const& actionTable() const { return *actionTable_; }
90 
94  std::shared_ptr<ProcessConfiguration const> processConfiguration,
95  std::string const& label);
96 
97  void resetAll();
98 
99  private:
105  };
106 
107  template <typename T, typename U>
109  typename T::TransitionInfoType& info,
110  ServiceToken const& token,
111  StreamID streamID,
112  typename T::Context const* topContext,
113  U const* context) {
114  //make sure the unscheduled items see this run or lumi transition
115  unscheduled_.runNowAsync<T, U>(std::move(task), info, token, streamID, topContext, context);
116  }
117 
118  template <typename T>
120  typename T::TransitionInfoType const& info,
121  ServiceToken const& token,
122  StreamID streamID,
123  ParentContext const& parentContext,
124  typename T::Context const* context) {
125  unscheduled_.runAccumulatorsAsync<T>(std::move(task), info, token, streamID, parentContext, context);
126  }
127 } // namespace edm
128 
129 #endif
static const TGPicture * info(bool iBackgroundIsBlack)
void endStream(StreamID iID, StreamContext &streamContext)
void processAccumulatorsAsync(WaitingTaskHolder, typename T::TransitionInfoType const &, ServiceToken const &, StreamID, ParentContext const &, typename T::Context const *)
UnscheduledCallProducer unscheduled_
void addToUnscheduledWorkers(ParameterSet &pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration > processConfiguration, std::string label, std::set< std::string > &unscheduledLabels, std::vector< std::string > &shouldBeUsedLabels)
AllWorkers allWorkers_
void setupOnDemandSystem(EventTransitionInfo const &)
void runNowAsync(WaitingTaskHolder task, typename T::TransitionInfoType const &info, ServiceToken const &token, StreamID streamID, typename T::Context const *topContext, U const *context) const
processConfiguration
Definition: Schedule.cc:687
void deleteModuleIfExists(std::string const &moduleLabel)
void beginJob(ProductRegistry const &iRegistry, eventsetup::ESRecordsToProxyIndices const &, ProcessBlockHelperBase const &)
actions
Definition: Schedule.cc:687
ExceptionToActionTable const * actionTable_
void const * lastSetupEventPrincipal_
void processOneOccurrenceAsync(WaitingTaskHolder, typename T::TransitionInfoType &, ServiceToken const &, StreamID, typename T::Context const *topContext, U const *context)
std::vector< Worker * > AllWorkers
Definition: WorkerManager.h:38
char const * label
def move
Definition: eostools.py:511
void beginStream(StreamID iID, StreamContext &streamContext)
AllWorkers const & allWorkers() const
Definition: WorkerManager.h:85
void setupResolvers(Principal &principal)
WorkerRegistry workerReg_
The Registry of all workers that where requested Holds all instances of workers. In this implementati...
T w() const
WorkerManager(std::shared_ptr< ActivityRegistry > actReg, ExceptionToActionTable const &actions)
preg
Definition: Schedule.cc:687
long double T
Worker * getWorker(ParameterSet &pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, std::string const &label)
ExceptionToActionTable const & actionTable() const
Definition: WorkerManager.h:89
prealloc
Definition: Schedule.cc:687
void addToAllWorkers(Worker *w)
void runAccumulatorsAsync(WaitingTaskHolder task, typename T::TransitionInfoType const &info, ServiceToken const &token, StreamID streamID, ParentContext const &parentContext, typename T::Context const *context)