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>
18#include <TSystem.h>
19#include <sstream>
20
21//
22// method implementations
23//
24
26
27namespace EL
28{
29 void LSFDriver ::
30 testInvariant () const
31 {
32 RCU_INVARIANT (this != 0);
33 }
34
35
36
37 LSFDriver ::
38 LSFDriver ()
39 {
40 RCU_NEW_INVARIANT (this);
41 }
42
43
44
45 ::StatusCode LSFDriver ::
46 doManagerStep (Detail::ManagerData& data) const
47 {
48 RCU_READ_INVARIANT (this);
49 using namespace msgEventLoop;
51 switch (data.step)
52 {
55 {
56 // safely ignoring: resubmit
57
58 std::ostringstream cmd;
59 cmd << "cd " << data.submitDir << "/submit";
60 for (std::size_t iter : data.batchJobIndices)
61 {
62 cmd << " && bsub " << data.options.castString (Job::optSubmitFlags);
63 if (data.options.castBool (Job::optResetShell, true))
64 cmd << " -L /bin/bash";
65 cmd << " " << data.submitDir << "/submit/run " << iter;
66 }
67 if (gSystem->Exec (cmd.str().c_str()) != 0)
68 {
69 ANA_MSG_ERROR ("failed to execute: " << cmd.str());
70 return StatusCode::FAILURE;
71 }
72 data.submitted = true;
73 }
74 break;
75
76 default:
77 break;
78 }
79 return ::StatusCode::SUCCESS;
80 }
81}
#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
ClassImp(EL::LSFDriver) namespace EL
Definition LSFDriver.cxx:25
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.