ATLAS Offline Software
Loading...
Searching...
No Matches
LLDriver.cxx File Reference
#include <EventLoop/LLDriver.h>
#include <AsgMessaging/StatusCode.h>
#include <EventLoop/Job.h>
#include <EventLoop/ManagerData.h>
#include <EventLoop/MessageCheck.h>
#include <TSystem.h>
#include <sstream>
Include dependency graph for LLDriver.cxx:

Go to the source code of this file.

Functions

std::string convertInt (int number)
 ClassImp (EL::LLDriver) namespace EL

Function Documentation

◆ ClassImp()

ClassImp ( EL::LLDriver )

Definition at line 33 of file LLDriver.cxx.

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}
#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

◆ convertInt()

std::string convertInt ( int number)
Author
Morten Dam Joergensen 2012.
Nils Krumnack

Definition at line 26 of file LLDriver.cxx.

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}
static Double_t ss
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186