ATLAS Offline Software
Loading...
Searching...
No Matches
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
virtual::StatusCode doManagerStep (Detail::ManagerData &data) const override
 do whatever needs to be done for the given submission step

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 if (file == nullptr || file->IsZombie())
81 {
82 ANA_MSG_ERROR ("failed to open " << data.submitDir << "/driver.root for writing");
83 return ::StatusCode::FAILURE;
84 }
85 file->WriteObject (data.driver, "driver");
86 file->Close ();
87 }
88 data.job->sampleHandler().save (data.submitDir + "/input");
89 {
90 std::ofstream file ((data.submitDir + "/location").c_str());
91 file << data.submitDir << "\n";
92 }
93
94 SH::SampleHandler sh_hist;
95 for (SH::Sample *sample : data.job->sampleHandler())
96 {
97 const std::string histfile
98 = data.submitDir + "/hist-" + sample->name() + ".root";
99 std::unique_ptr<SH::SampleHist> hist
100 (new SH::SampleHist (sample->name(), histfile));
101 hist->meta()->fetch (*sample->meta());
102 sh_hist.add (std::move (hist));
103 }
104 sh_hist.save (data.submitDir + "/hist");
105 }
106 break;
107
109 {
110 ANA_MSG_INFO ("submitting job in " << data.submitDir);
111 }
112 break;
113
115 {
116 if (!data.submitted)
117 {
118 ANA_MSG_FATAL ("Driver::submit not implemented in class " << typeid(*data.driver).name());
119 std::abort ();
120 }
121
122 ANA_MSG_DEBUG ("make submitted");
123 // this particular file can be checked to see if a job has
124 // been submitted successfully.
125 std::ofstream ((data.submitDir + "/submitted").c_str());
126 }
127 break;
128
130 {
132 }
133 break;
134
136 {
137 if (!data.submitted)
138 {
139 ANA_MSG_FATAL ("Driver::resubmit not implemented in class " << typeid(*data.driver).name());
140 std::abort ();
141 }
142
144 }
145 break;
146
147 default:
148 (void) true; // safe to do nothing
149 }
150 return ::StatusCode::SUCCESS;
151 }
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
#define ANA_MSG_DEBUG(xmsg,...)
Macro printing debug messages.
#define ANA_MSG_INFO(xmsg,...)
Macro printing info messages.
#define ANA_MSG_FATAL(xmsg,...)
Macro printing fatal messages.
static const std::string optDisableMetrics
description: the option to turn off collection of performance data
Definition Job.h:409
static const std::string name
description: the name of the service
Definition MetricsSvc.h:26
void save(const std::string &directory) const
save the list of samples to the given directory
void add(const Sample &sample)
add a copy of the sample to the handler
@ finalSubmit
the final submit step
@ finalResubmit
the final resubmit step
@ submitJob
do the actual job submission
Definition ManagerStep.h:92
@ addSystemAlgs
add any system algorithms to the job that may need to get added
Definition ManagerStep.h:71
@ fillOptions
in this step we fill the options structure, combining the different locations from which we can pull ...
Definition ManagerStep.h:56
@ initial
this is just the initial step we do, nothing really happens here
Definition ManagerStep.h:45
@ prepareSubmitDir
prepare files in our submission directory
Definition ManagerStep.h:74
@ postSubmit
do whatever needs to be done after the submission is done
Definition ManagerStep.h:98
@ initialSubmit
the initial submit step
Definition ManagerStep.h:48
@ initialResubmit
the initial resubmit step
TFile * file

◆ 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 }
@ OPERATION
the base-operation performed (e.g. submit, retrieve)

The documentation for this class was generated from the following files: