ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15#include <EventLoop/BatchJob.h>
16#include <EventLoop/Manager.h>
19
20using namespace EL::msgEventLoop;
21
22//
23// method implementations
24//
25
26namespace 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
52 ::StatusCode ManagerData ::
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 }
73 return ::StatusCode::SUCCESS;
74 }
75 }
76}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
ManagerStep
the individual steps of preparing a job for submission
Definition ManagerStep.h:42
@ initial
this is just the initial step we do, nothing really happens here
Definition ManagerStep.h:45
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string submitDir
the path to the submission directory
Definition ManagerData.h:66
ManagerStep step
the current ManagerStep
std::map< std::pair< ManagerOrder, std::string >, std::unique_ptr< Manager > > managers
the list of managers to run
ManagerStep nextStep
the next ManagerStep