ATLAS Offline Software
Loading...
Searching...
No Matches
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>
19#include <TSystem.h>
20#include <sstream>
21
22//
23// method implementations
24//
25
26std::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
34
35
36namespace 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;
60 switch (data.step)
61 {
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
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}
#define RCU_INVARIANT(x)
Definition Assert.h:189
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:221
#define RCU_READ_INVARIANT(x)
Definition Assert.h:217
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
static Double_t ss
ClassImp(EL::LLDriver) namespace EL
Definition LLDriver.cxx:33
std::string convertInt(int number)
Definition LLDriver.cxx:26
virtual::StatusCode doManagerStep(Detail::ManagerData &data) const override
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
Definition Job.h:292
a Driver for running on IBM Load Leveler batch systems
Definition LLDriver.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.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186