ATLAS Offline Software
LSFDriver.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 //
9 // includes
10 //
11 
12 #include <EventLoop/LSFDriver.h>
13 
15 #include <EventLoop/Job.h>
16 #include <EventLoop/ManagerData.h>
17 #include <EventLoop/MessageCheck.h>
18 #include <RootCoreUtils/ThrowMsg.h>
19 #include <TSystem.h>
20 #include <sstream>
21 
22 //
23 // method implementations
24 //
25 
27 
28 namespace EL
29 {
30  void LSFDriver ::
31  testInvariant () const
32  {
33  RCU_INVARIANT (this != 0);
34  }
35 
36 
37 
39  LSFDriver ()
40  {
41  RCU_NEW_INVARIANT (this);
42  }
43 
44 
45 
47  doManagerStep (Detail::ManagerData& data) const
48  {
49  RCU_READ_INVARIANT (this);
50  using namespace msgEventLoop;
52  switch (data.step)
53  {
56  {
57  // safely ignoring: resubmit
58 
59  std::ostringstream cmd;
60  cmd << "cd " << data.submitDir << "/submit";
61  for (std::size_t iter : data.batchJobIndices)
62  {
63  cmd << " && bsub " << data.options.castString (Job::optSubmitFlags);
64  if (data.options.castBool (Job::optResetShell, true))
65  cmd << " -L /bin/bash";
66  cmd << " " << data.submitDir << "/submit/run " << iter;
67  }
68  if (gSystem->Exec (cmd.str().c_str()) != 0)
69  RCU_THROW_MSG (("failed to execute: " + cmd.str()).c_str());
70  data.submitted = true;
71  }
72  break;
73 
74  default:
75  break;
76  }
77  return ::StatusCode::SUCCESS;
78  }
79 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EL::BatchDriver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
LSFDriver.h
rerun_display.cmd
string cmd
Definition: rerun_display.py:67
Job.h
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
MessageCheck.h
EL::LSFDriver::LSFDriver
LSFDriver()
effects: standard default constructor guarantee: strong failures: low level errors I
EL::Detail::ManagerStep::doResubmit
@ doResubmit
call the actual doResubmit method
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL::Job::optResetShell
static const std::string optResetShell
description: the option to reset the shell on the worker nodes rationale: this is currently only used...
Definition: Job.h:428
ManagerData.h
EL::LSFDriver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
EL::LSFDriver
a Driver for running on LSF batch systems
Definition: LSFDriver.h:21
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
EL::Job::optSubmitFlags
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
Definition: Job.h:293
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
StatusCode.h
ThrowMsg.h
ClassImp
ClassImp(EL::LSFDriver) namespace EL
Definition: LSFDriver.cxx:26
RCU_THROW_MSG
#define RCU_THROW_MSG(message)
Definition: PrintMsg.h:58
EL::LSFDriver::testInvariant
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
EL::Detail::ManagerStep::submitJob
@ submitJob
do the actual job submission
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233