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>
20#include <TSystem.h>
21#include <sstream>
22
23//
24// method implementations
25//
26
27std::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
37namespace EL
38{
39 void LLDriver ::
40 testInvariant () const
41 {
42 RCU_INVARIANT (this != 0);
43 }
44
45
46
47 LLDriver ::
48 LLDriver ()
49 {
50 RCU_NEW_INVARIANT (this);
51 }
52
53
54
55 ::StatusCode LLDriver ::
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}
#define RCU_INVARIANT(x)
Definition Assert.h:201
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233
#define RCU_READ_INVARIANT(x)
Definition Assert.h:229
#define ANA_CHECK(EXP)
check whether the given expression was successful
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t ss
ClassImp(EL::LLDriver) namespace EL
Definition LLDriver.cxx:34
std::string convertInt(int number)
Definition LLDriver.cxx:27
#define RCU_THROW_MSG(message)
Definition PrintMsg.h:58
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:296
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.
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186