ATLAS Offline Software
Public Member Functions | List of all members
EL::Detail::SubmitManager Class Referencefinal

#include <SubmitManager.h>

Inheritance diagram for EL::Detail::SubmitManager:
Collaboration diagram for EL::Detail::SubmitManager:

Public Member Functions

virtual std::pair< Detail::ManagerOrder, std::string > getManagerOrder () const noexcept override
 get the order/name of this manager More...
 
virtual ::StatusCode doManagerStep (Detail::ManagerData &data) const override
 do whatever needs to be done for the given submission step More...
 

Detailed Description

Definition at line 20 of file SubmitManager.h.

Member Function Documentation

◆ doManagerStep()

StatusCode EL::Detail::SubmitManager::doManagerStep ( Detail::ManagerData data) const
overridevirtual

do whatever needs to be done for the given submission step

Guarantee
basic
Failures
job configuration errors
driver errors

Implements EL::Detail::Manager.

Definition at line 47 of file SubmitManager.cxx.

49  {
50  switch (data.step)
51  {
53  {
54  if (data.resubmit)
56  else
58  }
59  break;
60 
62  {
63  data.options = *data.job->options();
64  data.options.fetchDefaults (*data.driver->options());
65  }
66  break;
67 
69  {
70  if (data.options.castBool (Job::optDisableMetrics, false))
71  if (!data.job->algsHas (MetricsSvc::name))
72  data.job->algsAdd (new MetricsSvc);
73  }
74  break;
75 
77  {
78  {
79  std::unique_ptr<TFile> file (TFile::Open ((data.submitDir + "/driver.root").c_str(), "RECREATE"));
80  file->WriteObject (data.driver, "driver");
81  file->Close ();
82  }
83  data.job->sampleHandler().save (data.submitDir + "/input");
84  {
85  std::ofstream file ((data.submitDir + "/location").c_str());
86  file << data.submitDir << "\n";
87  }
88 
89  SH::SampleHandler sh_hist;
90  for (SH::SampleHandler::iterator sample = data.job->sampleHandler().begin(),
91  end = data.job->sampleHandler().end(); sample != end; ++ sample)
92  {
93  const std::string histfile
94  = data.submitDir + "/hist-" + (*sample)->name() + ".root";
95  std::unique_ptr<SH::SampleHist> hist
96  (new SH::SampleHist ((*sample)->name(), histfile));
97  hist->meta()->fetch (*(*sample)->meta());
98  sh_hist.add (hist.release());
99  }
100  sh_hist.save (data.submitDir + "/hist");
101  }
102  break;
103 
105  {
106  ANA_MSG_INFO ("submitting job in " << data.submitDir);
107  }
108  break;
109 
111  {
112  if (!data.submitted)
113  {
114  ANA_MSG_FATAL ("Driver::submit not implemented in class " << typeid(*data.driver).name());
115  std::abort ();
116  }
117 
118  ANA_MSG_DEBUG ("make submitted");
119  // this particular file can be checked to see if a job has
120  // been submitted successfully.
121  std::ofstream ((data.submitDir + "/submitted").c_str());
122  }
123  break;
124 
126  {
127  data.nextStep = Detail::ManagerStep::final;
128  }
129  break;
130 
132  {
133  if (!data.submitted)
134  {
135  ANA_MSG_FATAL ("Driver::resubmit not implemented in class " << typeid(*data.driver).name());
136  std::abort ();
137  }
138 
139  data.nextStep = Detail::ManagerStep::final;
140  }
141  break;
142 
143  default:
144  (void) true; // safe to do nothing
145  }
146  return ::StatusCode::SUCCESS;
147  }

◆ getManagerOrder()

std::pair< Detail::ManagerOrder, std::string > EL::Detail::SubmitManager::getManagerOrder ( ) const
overridevirtualnoexcept

get the order/name of this manager

This is both used to identify the manager we are looking at, and to make sure they get executed in the right order. It is a mistake to load two managers that report the same order.

This is a pair of an enum that defines the absolute order of managers, and a string that identifies the stream that this manager belongs to. If this manager is not specific to a stream this should be the empty stream.

Guarantee
no-fail

Implements EL::Detail::Manager.

Definition at line 39 of file SubmitManager.cxx.

41  {
42  return std::make_pair (ManagerOrder::OPERATION, "");
43  }

The documentation for this class was generated from the following files:
EL::Detail::ManagerOrder::OPERATION
@ OPERATION
the base-operation performed (e.g. submit, retrieve)
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
EL::Detail::ManagerStep::fillOptions
@ fillOptions
in this step we fill the options structure, combining the different locations from which we can pull ...
SH::SampleHandler::iterator
std::vector< Sample * >::const_iterator iterator
the iterator to use
Definition: SampleHandler.h:475
SH::SampleHandler::add
void add(Sample *sample)
add a sample to the handler
EL::MetricsSvc::name
static const std::string name
description: the name of the service
Definition: MetricsSvc.h:26
EL::Detail::ManagerStep::postSubmit
@ postSubmit
do whatever needs to be done after the submission is done
plotmaker.hist
hist
Definition: plotmaker.py:148
SH::SampleHist
A sample that represents a single histogram file.
Definition: SampleHist.h:31
EL::Detail::ManagerStep::final
@ final
EL::Job::optDisableMetrics
static const std::string optDisableMetrics
description: the option to turn off collection of performance data
Definition: Job.h:421
EL::Detail::ManagerStep::addSystemAlgs
@ addSystemAlgs
add any system algorithms to the job that may need to get added
EL::Detail::ManagerStep::finalResubmit
@ finalResubmit
the final resubmit step
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
SH::SampleHandler::save
void save(const std::string &directory) const
save the list of samples to the given directory
EL::Detail::ManagerStep::initialSubmit
@ initialSubmit
the initial submit step
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
file
TFile * file
Definition: tile_monitor.h:29
EL::Detail::ManagerStep::initial
@ initial
this is just the initial step we do, nothing really happens here
ANA_MSG_FATAL
#define ANA_MSG_FATAL(xmsg)
Macro printing fatal messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:296
EL::Detail::ManagerStep::prepareSubmitDir
@ prepareSubmitDir
prepare files in our submission directory
EL::Detail::ManagerStep::finalSubmit
@ finalSubmit
the final submit step
SH::SampleHandler
A class that manages a list of Sample objects.
Definition: SampleHandler.h:60
module_driven_slicing.histfile
histfile
Definition: module_driven_slicing.py:571
EL::Detail::ManagerStep::submitJob
@ submitJob
do the actual job submission
EL::Detail::ManagerStep::initialResubmit
@ initialResubmit
the initial resubmit step
ANA_MSG_DEBUG
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:288