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 <RootCoreUtils/ShellExec.h>
#include <TSystem.h>
#include <sstream>
Include dependency graph for LLDriver.cxx:

Go to the source code of this file.

Functions

 ClassImp (EL::LLDriver) namespace EL

Function Documentation

◆ ClassImp()

ClassImp ( EL::LLDriver )
Author
Morten Dam Joergensen 2012.
Nils Krumnack

Definition at line 27 of file LLDriver.cxx.

31{
32 void LLDriver ::
33 testInvariant () const
34 {}
35
36
37
38 LLDriver ::
39 LLDriver ()
40 {
41 RCU_NEW_INVARIANT (this);
42 }
43
44
45
46 ::StatusCode LLDriver ::
47 doManagerStep (Detail::ManagerData& data) const
48 {
49 RCU_READ_INVARIANT (this);
50 using namespace msgEventLoop;
51 ANA_CHECK (BatchDriver::doManagerStep (data));
52 switch (data.step)
53 {
54 case Detail::ManagerStep::batchScriptVar:
55 {
56 data.batchName = "run{JOBID}.cmd";
57 data.batchInit =
58 "#\n"
59 "# @ job_name = EventLoopAnalysis{JOBID}\n"
60 "# @ job_type = serial\n"
61 "# @ error = $(Cluster).err\n"
62 "# @ output = $(Cluster).out\n"
63 "# @ class = " + queue + "\n"
64 "# @ resources = ConsumableCpus(1) ConsumableMemory(4gb)\n"
65 "# @ wall_clock_limit = 00:20:00\n"
66 "# @ queue\n";
67 }
68 break;
69
70 case Detail::ManagerStep::submitJob:
71 case Detail::ManagerStep::doResubmit:
72 {
73 // safely ignoring: resubmit
74
75 // Submit n jobs with loadleveler
76 for (std::size_t iter : data.batchJobIndices)
77 {
78 // Submit!
79
80 std::ostringstream cmd;
81 cmd << "cd " << RCU::Shell::quote (data.submitDir) << "/submit && llsubmit "
82 << data.options.castString (Job::optSubmitFlags)
83 << " run"<<iter<<".cmd";
84
85 if (gSystem->Exec (cmd.str().c_str()) != 0)
86 {
87 ANA_MSG_ERROR ("failed to execute: " << cmd.str());
88 return StatusCode::FAILURE;
89 }
90 }
91 data.submitted = true;
92 }
93 break;
94
95 default:
96 break;
97 }
98 return ::StatusCode::SUCCESS;
99 }
100}
#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
std::string quote(const std::string &name)
effects: quote the given name to protect it from the shell returns: the quoted name guarantee: strong...
Definition ShellExec.cxx:65