ATLAS Offline Software
DirectDriver.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/DirectDriver.h>
13 
14 #include <iostream>
15 #include <memory>
16 #include <TSystem.h>
17 #include <EventLoop/Job.h>
18 #include <EventLoop/ManagerData.h>
19 #include <EventLoop/ManagerStep.h>
20 #include <EventLoop/MessageCheck.h>
21 #include <EventLoop/Worker.h>
22 #include <EventLoop/OutputStream.h>
23 #include <RootCoreUtils/Assert.h>
25 #include <SampleHandler/Sample.h>
29 
30 //
31 // method implementations
32 //
33 
35 
36 namespace EL
37 {
38  void DirectDriver ::
39  testInvariant () const
40  {
41  RCU_INVARIANT (this != 0);
42  }
43 
44 
45 
48  {
49  RCU_NEW_INVARIANT (this);
50  }
51 
52 
53 
55  doManagerStep (Detail::ManagerData& data) const
56  {
57  using namespace msgEventLoop;
59  switch (data.step)
60  {
62  {
63  for (Job::outputMIter out = data.job->outputBegin(),
64  end = data.job->outputEnd(); out != end; ++ out)
65  {
66  if (out->output() == 0)
67  {
68  out->output (new SH::DiskOutputLocal
69  (data.submitDir + "/data-" + out->label() + "/"));
70  }
71  }
72  }
73  break;
74 
76  {
77  for (SH::SampleHandler::iterator sample = data.job->sampleHandler().begin(),
78  end = data.job->sampleHandler().end(); sample != end; ++ sample)
79  {
80  Worker worker;
81  ANA_CHECK (worker.directExecute (*sample, *data.job, data.submitDir, data.options));
82  }
83  data.submitted = true;
84  }
85  break;
86 
88  {
90  }
91  break;
92 
94  {
95  data.retrieved = true;
96  data.completed = true;
97  }
98  break;
99 
100  default:
101  (void) true; // safe to do nothing
102  }
103  return ::StatusCode::SUCCESS;
104  }
105 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EL::Driver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const
SH::SampleHandler::iterator
std::vector< Sample * >::const_iterator iterator
the iterator to use
Definition: SampleHandler.h:475
EL::DirectDriver::doManagerStep
virtual ::StatusCode doManagerStep(Detail::ManagerData &data) const override
EL::Job::outputMIter
OutputStream * outputMIter
description: the list of output datasets used guarantee: no-fail / strong failures(3): out of memory ...
Definition: Job.h:142
DiskOutputLocal.h
SH::DiskOutputLocal
an implementation of DiskOutput for local disks
Definition: DiskOutputLocal.h:23
Job.h
OutputStream.h
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
SampleHandler.h
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
Assert.h
ClassImp
ClassImp(EL::DirectDriver) namespace EL
Definition: DirectDriver.cxx:34
MessageCheck.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SamplePtr.h
SampleLocal.h
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
EL::Detail::ManagerStep::updateOutputLocation
@ updateOutputLocation
in this step we update the output location of streams that don't yet have one defined
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ManagerData.h
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
EL::Detail::ManagerStep::doRetrieve
@ doRetrieve
call the actual doRetrieve method
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
EL::DirectDriver
a Driver that runs directly inside the submission job itself
Definition: DirectDriver.h:25
EL::Driver::diskOutputSave
static void diskOutputSave(Detail::ManagerData &data)
make the output sample handler for the given job or stream from the information stored in the histogr...
EL::DirectDriver::testInvariant
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
EL::DirectDriver::DirectDriver
DirectDriver()
effects: standard default constructor guarantee: strong failures: low level errors I
Worker.h
DirectDriver.h
ManagerStep.h
EL::Detail::ManagerStep::submitJob
@ submitJob
do the actual job submission
Sample.h
EL::Detail::ManagerStep::directSaveOutput
@ directSaveOutput
save the output in the direct driver
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233