ATLAS Offline Software
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 
16 #include <EventLoop/Job.h>
17 #include <EventLoop/ManagerData.h>
18 #include <EventLoop/MessageCheck.h>
19 #include <RootCoreUtils/ThrowMsg.h>
20 #include <TSystem.h>
21 #include <sstream>
22 
23 //
24 // method implementations
25 //
26 
27 std::string convertInt(int number)
28 {
29  std::stringstream ss;//create a stringstream
30  ss << number;//add number to the stream
31  return ss.str();//return a string with the contents of the stream
32 }
33 
35 
36 
37 namespace EL
38 {
39  void LLDriver ::
40  testInvariant () const
41  {
42  RCU_INVARIANT (this != 0);
43  }
44 
45 
46 
48  LLDriver ()
49  {
50  RCU_NEW_INVARIANT (this);
51  }
52 
53 
54 
56  doManagerStep (Detail::ManagerData& data) const
57  {
58  RCU_READ_INVARIANT (this);
59  using namespace msgEventLoop;
61  switch (data.step)
62  {
64  {
65  data.batchName = "run{JOBID}.cmd";
66  data.batchInit =
67  "#\n"
68  "# @ job_name = EventLoopAnalysis{JOBID}\n"
69  "# @ job_type = serial\n"
70  "# @ error = $(Cluster).err\n"
71  "# @ output = $(Cluster).out\n"
72  "# @ class = " + queue + "\n"
73  "# @ resources = ConsumableCpus(1) ConsumableMemory(4gb)\n"
74  "# @ wall_clock_limit = 00:20:00\n"
75  "# @ queue\n";
76  }
77  break;
78 
81  {
82  // safely ignoring: resubmit
83 
84  // Submit n jobs with loadleveler
85  for (std::size_t iter : data.batchJobIndices)
86  {
87  // Submit!
88 
89  std::ostringstream cmd;
90  cmd << "cd " << data.submitDir << "/submit && llsubmit "
91  << data.options.castString (Job::optSubmitFlags)
92  << " run"<<iter<<".cmd";
93 
94  if (gSystem->Exec (cmd.str().c_str()) != 0)
95  RCU_THROW_MSG (("failed to execute: " + cmd.str()).c_str());
96  }
97  data.submitted = true;
98  }
99  break;
100 
101  default:
102  break;
103  }
104  return ::StatusCode::SUCCESS;
105  }
106 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ClassImp
ClassImp(EL::LLDriver) namespace EL
Definition: LLDriver.cxx:34
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
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
EL::LLDriver::testInvariant
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
rerun_display.cmd
string cmd
Definition: rerun_display.py:67
Job.h
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
MessageCheck.h
convertInt
std::string convertInt(int number)
Definition: LLDriver.cxx:27
LLDriver.h
EL::Detail::ManagerStep::doResubmit
@ doResubmit
call the actual doResubmit method
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ManagerData.h
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
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:293
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
StatusCode.h
EL::LLDriver
a Driver for running on IBM Load Leveler batch systems
Definition: LLDriver.h:27
python.selection.number
number
Definition: selection.py:20
ThrowMsg.h
EL::LLDriver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
EL::LLDriver::LLDriver
LLDriver()
effects: standard default constructor guarantee: strong failures: low level errors I
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
EL::LLDriver::queue
std::string queue
description: the queue we run on
Definition: LLDriver.h:47
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233