ATLAS Offline Software
ManagerData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 //
10 // includes
11 //
12 
13 #include <EventLoop/ManagerData.h>
14 
15 #include <EventLoop/BatchJob.h>
16 #include <EventLoop/Manager.h>
17 #include <EventLoop/MessageCheck.h>
18 #include <RootCoreUtils/Assert.h>
19 
20 using namespace EL::msgEventLoop;
21 
22 //
23 // method implementations
24 //
25 
26 namespace EL
27 {
28  namespace Detail
29  {
30  ManagerData ::
31  ManagerData () noexcept
32  {}
33 
34 
35 
36  ManagerData ::
37  ~ManagerData () noexcept
38  {}
39 
40 
41 
42  void ManagerData ::
43  addManager (std::unique_ptr<Manager> manager)
44  {
45  if (managers.find (manager->getManagerOrder()) != managers.end())
46  throw std::logic_error ("duplicate manager order " + std::to_string (unsigned (manager->getManagerOrder().first)) + " " + manager->getManagerOrder().second);
47  managers.insert (std::make_pair (manager->getManagerOrder(), std::move (manager)));
48  }
49 
50 
51 
53  run ()
54  {
56  throw std::logic_error ("ManagerData::run() called twice");
57 
58  do
59  {
60  step = nextStep;
61  nextStep = Detail::ManagerStep (unsigned (step) + 1);
62  ANA_MSG_DEBUG ("running step " << unsigned (step) << " / " << unsigned (Detail::ManagerStep::final));
63  for (const auto& manager : managers)
64  {
65  if (manager.second->doManagerStep (*this).isFailure())
66  {
67  ANA_MSG_ERROR ("while performing manager step " << unsigned (step));
68  ANA_MSG_ERROR ("on submission directory " << submitDir);
69  return ::StatusCode::FAILURE;
70  }
71  }
72  } while (step != Detail::ManagerStep::final);
73  return ::StatusCode::SUCCESS;
74  }
75  }
76 }
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
EL::Detail::ManagerStep::final
@ final
Manager.h
Assert.h
MessageCheck.h
EL::Detail::ManagerStep
ManagerStep
the individual steps of preparing a job for submission
Definition: ManagerStep.h:42
FullCPAlgorithmsTest_eljob.submitDir
submitDir
Definition: FullCPAlgorithmsTest_eljob.py:160
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ManagerData.h
EL::Detail::ManagerStep::initial
@ initial
this is just the initial step we do, nothing really happens here
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
xAOD::DiTauJetParameters::Detail
Detail
Definition: DiTauDefs.h:38
BatchJob.h
LArCellBinning.step
step
Definition: LArCellBinning.py:158
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288