ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
SoGEDriver.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/SoGEDriver.h
>
14
15
#include <
AsgMessaging/StatusCode.h
>
16
#include <
EventLoop/Job.h
>
17
#include <
EventLoop/ManagerData.h
>
18
#include <
EventLoop/MessageCheck.h
>
19
#include <
RootCoreUtils/ShellExec.h
>
20
#include <TSystem.h>
21
#include <sstream>
22
23
//
24
// method implementations
25
//
26
27
ClassImp
(
EL::SoGEDriver
)
28
29
namespace
EL
30
{
31
void
SoGEDriver ::
32
testInvariant ()
const
33
{}
34
35
36
37
SoGEDriver ::
38
SoGEDriver ()
39
{
40
RCU_NEW_INVARIANT
(
this
);
41
}
42
43
44
45
::StatusCode
SoGEDriver ::
46
doManagerStep (Detail::ManagerData& data)
const
47
{
48
RCU_READ_INVARIANT
(
this
);
49
using namespace
msgEventLoop;
50
ANA_CHECK
(
BatchDriver::doManagerStep
(data));
51
switch
(data.step)
52
{
53
case
Detail::ManagerStep::batchScriptVar
:
54
{
55
data.batchJobId =
"EL_JOBID=$(($SGE_TASK_ID-1))\n"
;
56
}
57
break
;
58
59
case
Detail::ManagerStep::submitJob
:
60
case
Detail::ManagerStep::doResubmit
:
61
{
62
if
(data.resubmit)
63
{
64
ANA_MSG_ERROR
(
"resubmission not supported for the SoGE driver"
);
65
return
StatusCode::FAILURE;
66
}
67
68
if
(data.batchJobIndices.empty())
69
{
70
ANA_MSG_ERROR
(
"no job indices to submit"
);
71
return ::StatusCode::FAILURE;
72
}
73
if
(data.batchJobIndices.back() + 1 != data.batchJobIndices.size())
74
{
75
ANA_MSG_ERROR
(
"submitting a non-contiguous set of job indices is not supported"
);
76
return ::StatusCode::FAILURE;
77
}
78
const
std::size_t njob = data.batchJobIndices.size();
79
80
std::ostringstream cmd;
81
cmd <<
"cd "
<<
RCU::Shell::quote
(data.submitDir) <<
"/submit && qsub "
82
<< data.options.castString (
Job::optSubmitFlags
)
83
<<
" -t 1-"
<< (njob) <<
" run"
;
84
if
(gSystem->Exec (cmd.str().c_str()) != 0)
85
{
86
ANA_MSG_ERROR
(
"failed to execute: "
<< cmd.str());
87
return
StatusCode::FAILURE;
88
}
89
data.submitted =
true
;
90
}
91
break
;
92
93
default
:
94
break
;
95
}
96
return ::StatusCode::SUCCESS;
97
}
98
}
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition
Assert.h:221
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition
Assert.h:217
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:295
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
StatusCode.h
Job.h
ManagerData.h
MessageCheck.h
ShellExec.h
ClassImp
ClassImp(EL::SoGEDriver) namespace EL
Definition
SoGEDriver.cxx:27
SoGEDriver.h
EL::BatchDriver::doManagerStep
virtual::StatusCode doManagerStep(Detail::ManagerData &data) const override
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:292
EL::SoGEDriver
a Driver for running on SoGE(?) batch systems
Definition
SoGEDriver.h:21
EL::Detail::ManagerStep::doResubmit
@ doResubmit
call the actual doResubmit method
Definition
ManagerStep.h:116
EL::Detail::ManagerStep::submitJob
@ submitJob
do the actual job submission
Definition
ManagerStep.h:92
EL::Detail::ManagerStep::batchScriptVar
@ batchScriptVar
create the variables needed for the batch-run script
Definition
ManagerStep.h:83
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RCU::Shell::quote
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
Generated on
for ATLAS Offline Software by
1.17.0