ATLAS Offline Software
ExecDriver.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 //
9 // includes
10 //
11 
12 #include <EventLoop/ExecDriver.h>
13 
14 #include <EventLoop/ManagerData.h>
15 #include <EventLoop/MessageCheck.h>
16 #include <RootCoreUtils/ThrowMsg.h>
17 
18 //
19 // method implementations
20 //
21 
23 
24 namespace EL
25 {
26  void ExecDriver ::
27  testInvariant () const
28  {
29  RCU_INVARIANT (this != 0);
30  }
31 
32 
33 
35  ExecDriver ()
36  {
37  RCU_NEW_INVARIANT (this);
38  }
39 
40 
41 
43  doManagerStep (Detail::ManagerData& data) const
44  {
45  RCU_READ_INVARIANT (this);
46  using namespace msgEventLoop;
48  switch (data.step)
49  {
51  {
52  data.batchSkipReleaseSetup = true;
53  }
54  break;
55 
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 }
ExecDriver.h
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EL::Detail::ManagerStep::batchScriptVar
@ batchScriptVar
create the variables needed for the batch-run script
EL::BatchDriver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
EL::ExecDriver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
MessageCheck.h
EL::Detail::ManagerStep::doResubmit
@ doResubmit
call the actual doResubmit method
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
EL::ExecDriver::testInvariant
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ManagerData.h
EL::ExecDriver::ExecDriver
ExecDriver()
effects: standard default constructor guarantee: strong failures: low level errors I
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ThrowMsg.h
EL::ExecDriver
a Driver for running batch jobs locally as a new process
Definition: ExecDriver.h:27
ClassImp
ClassImp(EL::ExecDriver) namespace EL
Definition: ExecDriver.cxx:22
RCU_THROW_MSG
#define RCU_THROW_MSG(message)
Definition: PrintMsg.h:58
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
EL::Detail::ManagerStep::submitJob
@ submitJob
do the actual job submission
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233