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 <TSystem.h>
20
#include <sstream>
21
22
//
23
// method implementations
24
//
25
26
std::string
convertInt
(
int
number
)
27
{
28
std::stringstream
ss
;
//create a stringstream
29
ss
<<
number
;
//add number to the stream
30
return
ss
.str();
//return a string with the contents of the stream
31
}
32
33
ClassImp
(
EL::LLDriver
)
34
35
36
namespace
EL
37
{
38
void
LLDriver ::
39
testInvariant ()
const
40
{
41
RCU_INVARIANT
(
this
!= 0);
42
}
43
44
45
46
LLDriver ::
47
LLDriver ()
48
{
49
RCU_NEW_INVARIANT
(
this
);
50
}
51
52
53
54
::StatusCode
LLDriver ::
55
doManagerStep (Detail::ManagerData& data)
const
56
{
57
RCU_READ_INVARIANT
(
this
);
58
using namespace
msgEventLoop;
59
ANA_CHECK
(
BatchDriver::doManagerStep
(data));
60
switch
(data.step)
61
{
62
case
Detail::ManagerStep::batchScriptVar
:
63
{
64
data.batchName =
"run{JOBID}.cmd"
;
65
data.batchInit =
66
"#\n"
67
"# @ job_name = EventLoopAnalysis{JOBID}\n"
68
"# @ job_type = serial\n"
69
"# @ error = $(Cluster).err\n"
70
"# @ output = $(Cluster).out\n"
71
"# @ class = "
+ queue +
"\n"
72
"# @ resources = ConsumableCpus(1) ConsumableMemory(4gb)\n"
73
"# @ wall_clock_limit = 00:20:00\n"
74
"# @ queue\n"
;
75
}
76
break
;
77
78
case
Detail::ManagerStep::submitJob
:
79
case
Detail::ManagerStep::doResubmit
:
80
{
81
// safely ignoring: resubmit
82
83
// Submit n jobs with loadleveler
84
for
(std::size_t iter : data.batchJobIndices)
85
{
86
// Submit!
87
88
std::ostringstream cmd;
89
cmd <<
"cd "
<< data.submitDir <<
"/submit && llsubmit "
90
<< data.options.castString (
Job::optSubmitFlags
)
91
<<
" run"
<<iter<<
".cmd"
;
92
93
if
(gSystem->Exec (cmd.str().c_str()) != 0)
94
{
95
ANA_MSG_ERROR
(
"failed to execute: "
<< cmd.str());
96
return
StatusCode::FAILURE;
97
}
98
}
99
data.submitted =
true
;
100
}
101
break
;
102
103
default
:
104
break
;
105
}
106
return ::StatusCode::SUCCESS;
107
}
108
}
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition
Assert.h:189
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:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
StatusCode.h
Job.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
ClassImp
ClassImp(EL::LLDriver) namespace EL
Definition
LLDriver.cxx:33
convertInt
std::string convertInt(int number)
Definition
LLDriver.cxx:26
LLDriver.h
ManagerData.h
MessageCheck.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
number
std::string number(const double &d, const std::string &s)
Definition
utils.cxx:186
Generated on
for ATLAS Offline Software by
1.17.0