ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
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
17
#include <cerrno>
18
#include <cstring>
19
#include <string>
20
#include <unistd.h>
21
#include <vector>
22
23
//
24
// method implementations
25
//
26
27
ClassImp
(
EL::ExecDriver
)
28
29
namespace
EL
30
{
31
void
ExecDriver ::
32
testInvariant ()
const
33
{}
34
35
36
37
ExecDriver ::
38
ExecDriver ()
39
{
40
RCU_NEW_INVARIANT
(
this
);
41
}
42
43
44
45
::StatusCode
ExecDriver ::
46
doManagerStep (Detail::ManagerData& data)
const
47
{
48
RCU_READ_INVARIANT
(
this
);
49
using namespace
msgEventLoop;
50
ANA_CHECK
(
BatchDriver::doManagerStep
(data));
51
switch
(data.step)
52
{
53
case
Detail::ManagerStep::batchScriptVar
:
54
{
55
data.batchSkipReleaseSetup =
true
;
56
}
57
break
;
58
59
case
Detail::ManagerStep::submitJob
:
60
case
Detail::ManagerStep::doResubmit
:
61
{
62
// pass the actual list of indices to process (on resubmit this is
63
// the list of failed segments, not 0..N-1), plus whether this is a
64
// resubmit so the worker can tolerate the already-existing scratch
65
// directories.
66
std::vector<std::string> args;
67
args.push_back (
"eventloop_exec_worker"
);
68
args.push_back (data.submitDir);
69
args.push_back (data.resubmit ?
"1"
:
"0"
);
70
for
(std::size_t
index
: data.batchJobIndices)
71
args.push_back (std::to_string (
index
));
72
73
std::vector<char*> argv;
74
for
(std::string& arg : args)
75
argv.push_back (
const_cast<
char
*
>
(arg.c_str()));
76
argv.push_back (
nullptr
);
77
78
// this will replace the current program with a new one. that means
79
// that for better (or worse) we will not continue afterwards. this is
80
// fully intentional, as it releases all the memory we used for
81
// configuring the job. that is the whole point of this driver,
82
// releasing the >1GB of memory we use for configuration (in large parts
83
// ROOT-python dictionaries).
84
execvp(argv[0], argv.data());
85
auto
myerrno = errno;
86
ANA_MSG_ERROR
(
"failed to execute eventloop_exec_worker: "
<< strerror (myerrno));
87
return ::StatusCode::FAILURE;
88
}
89
break
;
90
91
default
:
92
break
;
93
}
94
return ::StatusCode::SUCCESS;
95
}
96
}
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition
Assert.h:221
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition
Assert.h:217
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:295
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
ClassImp
ClassImp(EL::ExecDriver) namespace EL
Definition
ExecDriver.cxx:27
ExecDriver.h
ManagerData.h
MessageCheck.h
EL::BatchDriver::doManagerStep
virtual::StatusCode doManagerStep(Detail::ManagerData &data) const override
EL::ExecDriver
a Driver for running batch jobs locally as a new process
Definition
ExecDriver.h:27
EL::Detail::ManagerStep::doResubmit
@ doResubmit
call the actual doResubmit method
Definition
ManagerStep.h:116
EL::Detail::ManagerStep::submitJob
@ submitJob
do the actual job submission
Definition
ManagerStep.h:92
EL::Detail::ManagerStep::batchScriptVar
@ batchScriptVar
create the variables needed for the batch-run script
Definition
ManagerStep.h:83
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0