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
28
29
30namespace EL
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;
52 switch (data.step)
53 {
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
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
ClassImp(EL::LLDriver) namespace EL
Definition LLDriver.cxx:27
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 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