ATLAS Offline Software
Loading...
Searching...
No Matches
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>
19#include <TSystem.h>
20#include <sstream>
21
22//
23// method implementations
24//
25
27
28namespace EL
29{
30 void LSFDriver ::
31 testInvariant () const
32 {}
33
34
35
36 LSFDriver ::
37 LSFDriver ()
38 {
39 RCU_NEW_INVARIANT (this);
40 }
41
42
43
44 ::StatusCode LSFDriver ::
45 doManagerStep (Detail::ManagerData& data) const
46 {
47 RCU_READ_INVARIANT (this);
48 using namespace msgEventLoop;
50 switch (data.step)
51 {
54 {
55 // safely ignoring: resubmit
56
57 std::ostringstream cmd;
58 cmd << "cd " << RCU::Shell::quote (data.submitDir) << "/submit";
59 for (std::size_t iter : data.batchJobIndices)
60 {
61 cmd << " && bsub " << data.options.castString (Job::optSubmitFlags);
62 if (data.options.castBool (Job::optResetShell, true))
63 cmd << " -L /bin/bash";
64 cmd << " " << RCU::Shell::quote (data.submitDir) << "/submit/run " << iter;
65 }
66 if (gSystem->Exec (cmd.str().c_str()) != 0)
67 {
68 ANA_MSG_ERROR ("failed to execute: " << cmd.str());
69 return StatusCode::FAILURE;
70 }
71 data.submitted = true;
72 }
73 break;
74
75 default:
76 break;
77 }
78 return ::StatusCode::SUCCESS;
79 }
80}
#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::LSFDriver) namespace EL
Definition LSFDriver.cxx:26
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
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:416
a Driver for running on LSF batch systems
Definition LSFDriver.h:21
@ doResubmit
call the actual doResubmit method
@ submitJob
do the actual job submission
Definition ManagerStep.h:92
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