ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDTools
EventLoop
Root
TorqueDriver.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/TorqueDriver.h
>
13
14
#include <
AsgMessaging/StatusCode.h
>
15
#include <
EventLoop/Job.h
>
16
#include <
EventLoop/ManagerData.h
>
17
#include <
EventLoop/MessageCheck.h
>
18
#include <TSystem.h>
19
#include <sstream>
20
21
//
22
// method implementations
23
//
24
25
ClassImp
(
EL::TorqueDriver
)
26
27
namespace
EL
28
{
29
void
TorqueDriver ::
30
testInvariant ()
const
31
{
32
RCU_INVARIANT
(
this
!= 0);
33
}
34
35
36
37
TorqueDriver ::
38
TorqueDriver ()
39
{
40
RCU_NEW_INVARIANT
(
this
);
41
}
42
43
44
45
::StatusCode
TorqueDriver ::
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=$PBS_ARRAYID\n"
;
56
}
57
break
;
58
59
60
case
Detail::ManagerStep::submitJob
:
61
case
Detail::ManagerStep::doResubmit
:
62
{
63
if
(data.resubmit)
64
{
65
ANA_MSG_ERROR
(
"resubmission not supported for the Torque driver"
);
66
return
StatusCode::FAILURE;
67
}
68
69
assert (!data.batchJobIndices.empty());
70
assert (data.batchJobIndices.back() + 1 == data.batchJobIndices.size());
71
const
std::size_t njob = data.batchJobIndices.size();
72
73
std::ostringstream cmd;
74
cmd <<
"cd "
<< data.submitDir <<
"/submit && qsub "
75
<< data.options.castString (
Job::optSubmitFlags
)
76
<<
" -t 0-"
<< (njob-1) <<
" run"
;
77
if
(gSystem->Exec (cmd.str().c_str()) != 0)
78
{
79
ANA_MSG_ERROR
(
"failed to execute: "
<< cmd.str());
80
return
StatusCode::FAILURE;
81
}
82
data.submitted =
true
;
83
}
84
break
;
85
86
default
:
87
break
;
88
}
89
return ::StatusCode::SUCCESS;
90
}
91
}
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition
Assert.h:189
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:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
StatusCode.h
Job.h
ManagerData.h
MessageCheck.h
ClassImp
ClassImp(EL::TorqueDriver) namespace EL
Definition
TorqueDriver.cxx:25
TorqueDriver.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::TorqueDriver
a Driver for running on Torque batch systems
Definition
TorqueDriver.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
Generated on
for ATLAS Offline Software by
1.17.0