ATLAS Offline Software
Functions
ExecDriver.cxx File Reference
#include <EventLoop/ExecDriver.h>
#include <EventLoop/ManagerData.h>
#include <EventLoop/MessageCheck.h>
#include <RootCoreUtils/ThrowMsg.h>
Include dependency graph for ExecDriver.cxx:

Go to the source code of this file.

Functions

 ClassImp (EL::ExecDriver) namespace EL
 

Function Documentation

◆ ClassImp()

ClassImp ( EL::ExecDriver  )
Author
Nils Krumnack

Definition at line 22 of file ExecDriver.cxx.

25 {
26  void ExecDriver ::
27  testInvariant () const
28  {
29  RCU_INVARIANT (this != 0);
30  }
31 
32 
33 
34  ExecDriver ::
35  ExecDriver ()
36  {
37  RCU_NEW_INVARIANT (this);
38  }
39 
40 
41 
42  ::StatusCode ExecDriver ::
43  doManagerStep (Detail::ManagerData& data) const
44  {
45  RCU_READ_INVARIANT (this);
46  using namespace msgEventLoop;
47  ANA_CHECK (BatchDriver::doManagerStep (data));
48  switch (data.step)
49  {
50  case Detail::ManagerStep::batchScriptVar:
51  {
52  data.batchSkipReleaseSetup = true;
53  }
54  break;
55 
56  case Detail::ManagerStep::submitJob:
57  case Detail::ManagerStep::doResubmit:
58  {
59  // safely ignoring: resubmit
60 
61  std::string maxIndex = std::to_string (data.batchJobIndices.size());
62  const char *argv[] = { "eventloop_exec_worker", data.submitDir.c_str(), maxIndex.c_str(), nullptr };
63 
64  // this will replace the current program with a new one. that means
65  // that for better (or worse) we will not continue afterwards. this is
66  // fully intentional, as it releases all the memory we used for
67  // configuring the job. that is the whole point of this driver,
68  // releasing the >1GB of memory we use for configuration (in large parts
69  // ROOT-python dictionaries).
70  execvp(argv[0], const_cast<char**>(argv));
71  auto myerrno = errno;
72  RCU_THROW_MSG ("failed to execute eventloop_exec_worker: " + std::string (strerror (myerrno)));
73  }
74  break;
75 
76  default:
77  break;
78  }
79  return ::StatusCode::SUCCESS;
80  }
81 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
RCU_THROW_MSG
#define RCU_THROW_MSG(message)
Definition: PrintMsg.h:58
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233