ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
LLDriver.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
7
8
9
//
10
// includes
11
//
12
13
#include <
EventLoop/LLDriver.h
>
14
15
#include <
AsgMessaging/StatusCode.h
>
16
#include <
EventLoop/Job.h
>
17
#include <
EventLoop/ManagerData.h
>
18
#include <
EventLoop/MessageCheck.h
>
19
#include <
RootCoreUtils/ShellExec.h
>
20
#include <TSystem.h>
21
#include <sstream>
22
23
//
24
// method implementations
25
//
26
27
ClassImp
(
EL::LLDriver
)
28
29
30
namespace
EL
31
{
32
void
LLDriver ::
33
testInvariant ()
const
34
{}
35
36
37
38
LLDriver ::
39
LLDriver ()
40
{
41
RCU_NEW_INVARIANT
(
this
);
42
}
43
44
45
46
::StatusCode
LLDriver ::
47
doManagerStep (Detail::ManagerData& data)
const
48
{
49
RCU_READ_INVARIANT
(
this
);
50
using namespace
msgEventLoop;
51
ANA_CHECK
(
BatchDriver::doManagerStep
(data));
52
switch
(data.step)
53
{
54
case
Detail::ManagerStep::batchScriptVar
:
55
{
56
data.batchName =
"run{JOBID}.cmd"
;
57
data.batchInit =
58
"#\n"
59
"# @ job_name = EventLoopAnalysis{JOBID}\n"
60
"# @ job_type = serial\n"
61
"# @ error = $(Cluster).err\n"
62
"# @ output = $(Cluster).out\n"
63
"# @ class = "
+ queue +
"\n"
64
"# @ resources = ConsumableCpus(1) ConsumableMemory(4gb)\n"
65
"# @ wall_clock_limit = 00:20:00\n"
66
"# @ queue\n"
;
67
}
68
break
;
69
70
case
Detail::ManagerStep::submitJob
:
71
case
Detail::ManagerStep::doResubmit
:
72
{
73
// safely ignoring: resubmit
74
75
// Submit n jobs with loadleveler
76
for
(std::size_t iter : data.batchJobIndices)
77
{
78
// Submit!
79
80
std::ostringstream cmd;
81
cmd <<
"cd "
<<
RCU::Shell::quote
(data.submitDir) <<
"/submit && llsubmit "
82
<< data.options.castString (
Job::optSubmitFlags
)
83
<<
" run"
<<iter<<
".cmd"
;
84
85
if
(gSystem->Exec (cmd.str().c_str()) != 0)
86
{
87
ANA_MSG_ERROR
(
"failed to execute: "
<< cmd.str());
88
return
StatusCode::FAILURE;
89
}
90
}
91
data.submitted =
true
;
92
}
93
break
;
94
95
default
:
96
break
;
97
}
98
return ::StatusCode::SUCCESS;
99
}
100
}
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
StatusCode.h
Job.h
ClassImp
ClassImp(EL::LLDriver) namespace EL
Definition
LLDriver.cxx:27
LLDriver.h
ManagerData.h
MessageCheck.h
ShellExec.h
EL::BatchDriver::doManagerStep
virtual::StatusCode doManagerStep(Detail::ManagerData &data) const override
EL::Job::optSubmitFlags
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
Definition
Job.h:292
EL::LLDriver
a Driver for running on IBM Load Leveler batch systems
Definition
LLDriver.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
RCU::Shell::quote
std::string quote(const std::string &name)
effects: quote the given name to protect it from the shell returns: the quoted name guarantee: strong...
Definition
ShellExec.cxx:65
Generated on
for ATLAS Offline Software by
1.17.0