ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
17
18//
19// method implementations
20//
21
23
24namespace EL
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;
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}
#define RCU_INVARIANT(x)
Definition Assert.h:201
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233
#define RCU_READ_INVARIANT(x)
Definition Assert.h:229
#define ANA_CHECK(EXP)
check whether the given expression was successful
ClassImp(EL::ExecDriver) namespace EL
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define RCU_THROW_MSG(message)
Definition PrintMsg.h:58
virtual::StatusCode doManagerStep(Detail::ManagerData &data) const override
a Driver for running batch jobs locally as a new process
Definition ExecDriver.h:27
@ doResubmit
call the actual doResubmit method
@ submitJob
do the actual job submission
Definition ManagerStep.h:92
@ batchScriptVar
create the variables needed for the batch-run script
Definition ManagerStep.h:83
This module defines the arguments passed from the BATCH driver to the BATCH worker.