ATLAS Offline Software
Loading...
Searching...
No Matches
EL::Detail::ManagerData Struct Referencefinal

an internal data structure for passing data between different manager objects anbd step More...

#include <ManagerData.h>

Collaboration diagram for EL::Detail::ManagerData:

Public Member Functions

 ManagerData () noexcept
 standard constructor
 ~ManagerData () noexcept
 standard destructor
void addManager (std::unique_ptr< Manager > manager)
 add the given manager
::StatusCode run ()
 run all the managers from start to finish

Public Attributes

const Driverdriver {nullptr}
 the driver we are working on/with
std::string submitDir
 the path to the submission directory
SubmitDirMode submitDirMode {SubmitDirMode::NO_CLOBBER}
 the mode with which we handle the submission directory
bool resubmit {false}
 whether we are merely resubmitting this job
std::string resubmitOption
 if we are resubmitting, the resubmit option chosen
SH::MetaObject options
 the options with which we submit this job
Jobjob {nullptr}
 the user job we are submitting
bool submitted {false}
 whether we successfully submitted the job in this process
bool retrieved {false}
 whether we successfully retrieved the job in this process
bool completed {false}
 whether the job completed
std::unique_ptr< BatchJobbatchJob
 if we run in batch, the batch job object we are using
std::vector< std::size_t > batchJobIndices
 if we run in batch, this is the list of job-indices to run
std::string batchName
 the name of the submission script to use.
std::string batchInit
 any additional code we need for setting up the batch job.
std::string batchJobId
 the code needed for setting EL_JOBID
bool batchSkipReleaseSetup {false}
 whether to skip the release setup
std::string batchWriteLocation
 the directory location for writing batch output
std::string batchSubmitLocation
 the directory location with batch input configuration
bool sharedFileSystem {true}
 whether we have/use a shared file system
std::set< std::size_t > batchJobSuccess
 the list of successful, failed, unknown batch segments
std::set< std::size_t > batchJobFailure
std::set< std::size_t > batchJobUnknown
ManagerStep step {ManagerStep::initial}
 the current ManagerStep
ManagerStep nextStep {ManagerStep::initial}
 the next ManagerStep
std::map< std::pair< ManagerOrder, std::string >, std::unique_ptr< Manager > > managers
 the list of managers to run

Detailed Description

an internal data structure for passing data between different manager objects anbd step

Essentially Manager objects don't talk to each other directly and don't cache any information between steps. So any data that needs to get stored and passed around instead gets added to this structure. Among other things this means that managers are only fairly loosely coupled and don't really need to know about each other.

Generally only some of the information in this structure will be used for any given operation. That is considered acceptable, as the cost of extra members in this data structure are very low. Though it does make for a rather large data structure.

Definition at line 45 of file ManagerData.h.

Constructor & Destructor Documentation

◆ ManagerData()

EL::Detail::ManagerData::ManagerData ( )
noexcept

standard constructor

This is mostly defined, so that this include file doesn't need to include a whole bunch of other files, just to destruct their objects

Definition at line 30 of file ManagerData.cxx.

32 {}

◆ ~ManagerData()

EL::Detail::ManagerData::~ManagerData ( )
noexcept

standard destructor

This is mostly defined, so that this include file doesn't need to include a whole bunch of other files, just to destruct their objects

Definition at line 36 of file ManagerData.cxx.

38 {}

Member Function Documentation

◆ addManager()

void EL::Detail::ManagerData::addManager ( std::unique_ptr< Manager > manager)

add the given manager

Guarantee
strong
Failures
duplicate order entry
out of memory I

Definition at line 42 of file ManagerData.cxx.

44 {
45 if (managers.find (manager->getManagerOrder()) != managers.end())
46 throw std::logic_error ("duplicate manager order " + std::to_string (unsigned (manager->getManagerOrder().first)) + " " + manager->getManagerOrder().second);
47 managers.insert (std::make_pair (manager->getManagerOrder(), std::move (manager)));
48 }
std::map< std::pair< ManagerOrder, std::string >, std::unique_ptr< Manager > > managers
the list of managers to run

◆ run()

StatusCode EL::Detail::ManagerData::run ( )

run all the managers from start to finish

Guarantee
basic
Failures
manager errors

Definition at line 52 of file ManagerData.cxx.

54 {
56 throw std::logic_error ("ManagerData::run() called twice");
57
58 do
59 {
60 step = nextStep;
61 nextStep = Detail::ManagerStep (unsigned (step) + 1);
62 ANA_MSG_DEBUG ("running step " << unsigned (step) << " / " << unsigned (Detail::ManagerStep::final));
63 for (const auto& manager : managers)
64 {
65 if (manager.second->doManagerStep (*this).isFailure())
66 {
67 ANA_MSG_ERROR ("while performing manager step " << unsigned (step));
68 ANA_MSG_ERROR ("on submission directory " << submitDir);
69 return ::StatusCode::FAILURE;
70 }
71 }
73 return ::StatusCode::SUCCESS;
74 }
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
ManagerStep
the individual steps of preparing a job for submission
Definition ManagerStep.h:42
@ initial
this is just the initial step we do, nothing really happens here
Definition ManagerStep.h:45
std::string submitDir
the path to the submission directory
Definition ManagerData.h:66
ManagerStep step
the current ManagerStep
ManagerStep nextStep
the next ManagerStep

Member Data Documentation

◆ batchInit

std::string EL::Detail::ManagerData::batchInit

any additional code we need for setting up the batch job.

if multiple files are used, {JOBID} will be replaced with the index of the current file.

Some batch systems need extra lines when making there submission scripts, which can either be specially formatted option lines or just some special commands.

Definition at line 120 of file ManagerData.h.

◆ batchJob

std::unique_ptr<BatchJob> EL::Detail::ManagerData::batchJob

if we run in batch, the batch job object we are using

Definition at line 96 of file ManagerData.h.

◆ batchJobFailure

std::set<std::size_t> EL::Detail::ManagerData::batchJobFailure

Definition at line 160 of file ManagerData.h.

◆ batchJobId

std::string EL::Detail::ManagerData::batchJobId

the code needed for setting EL_JOBID

Normally one can just pass the index of the job as the first argument to the execution script, but some systems instead use environment variables rationale.

This is not used if we have separate execution scripts from the job.

Definition at line 131 of file ManagerData.h.

◆ batchJobIndices

std::vector<std::size_t> EL::Detail::ManagerData::batchJobIndices

if we run in batch, this is the list of job-indices to run

Definition at line 100 of file ManagerData.h.

◆ batchJobSuccess

std::set<std::size_t> EL::Detail::ManagerData::batchJobSuccess

the list of successful, failed, unknown batch segments

Definition at line 159 of file ManagerData.h.

◆ batchJobUnknown

std::set<std::size_t> EL::Detail::ManagerData::batchJobUnknown

Definition at line 161 of file ManagerData.h.

◆ batchName

std::string EL::Detail::ManagerData::batchName

the name of the submission script to use.

if this contains {JOBID} it will create one script for each job id

Some batch systems are picky about names. Others don't allow passing arguments into submission scripts. So this allows being flexible.

Definition at line 110 of file ManagerData.h.

◆ batchSkipReleaseSetup

bool EL::Detail::ManagerData::batchSkipReleaseSetup {false}

whether to skip the release setup

Some batch drivers will setup the release in their own way, or will not need a release setup. Setting this to true will skip the standard release setup.

Besides avoiding to create the release setup commands, this will also suppress errors when the cmake-work-directory can not be located.

Definition at line 143 of file ManagerData.h.

143{false};

◆ batchSubmitLocation

std::string EL::Detail::ManagerData::batchSubmitLocation

the directory location with batch input configuration

Definition at line 151 of file ManagerData.h.

◆ batchWriteLocation

std::string EL::Detail::ManagerData::batchWriteLocation

the directory location for writing batch output

Definition at line 147 of file ManagerData.h.

◆ completed

bool EL::Detail::ManagerData::completed {false}

whether the job completed

Definition at line 93 of file ManagerData.h.

93{false};

◆ driver

const Driver* EL::Detail::ManagerData::driver {nullptr}

the driver we are working on/with

Definition at line 63 of file ManagerData.h.

63{nullptr};

◆ job

Job* EL::Detail::ManagerData::job {nullptr}

the user job we are submitting

Definition at line 82 of file ManagerData.h.

82{nullptr};

◆ managers

std::map<std::pair<ManagerOrder,std::string>,std::unique_ptr<Manager> > EL::Detail::ManagerData::managers

the list of managers to run

Definition at line 175 of file ManagerData.h.

◆ nextStep

ManagerStep EL::Detail::ManagerData::nextStep {ManagerStep::initial}

the next ManagerStep

By having this part of the manager data I am able to adjust the flow order via the managers (if desired)

Definition at line 171 of file ManagerData.h.

◆ options

SH::MetaObject EL::Detail::ManagerData::options

the options with which we submit this job

Definition at line 79 of file ManagerData.h.

◆ resubmit

bool EL::Detail::ManagerData::resubmit {false}

whether we are merely resubmitting this job

Definition at line 73 of file ManagerData.h.

73{false};

◆ resubmitOption

std::string EL::Detail::ManagerData::resubmitOption

if we are resubmitting, the resubmit option chosen

Definition at line 76 of file ManagerData.h.

◆ retrieved

bool EL::Detail::ManagerData::retrieved {false}

whether we successfully retrieved the job in this process

Definition at line 90 of file ManagerData.h.

90{false};

◆ sharedFileSystem

bool EL::Detail::ManagerData::sharedFileSystem {true}

whether we have/use a shared file system

Definition at line 155 of file ManagerData.h.

155{true};

◆ step

ManagerStep EL::Detail::ManagerData::step {ManagerStep::initial}

the current ManagerStep

Definition at line 165 of file ManagerData.h.

◆ submitDir

std::string EL::Detail::ManagerData::submitDir

the path to the submission directory

Definition at line 66 of file ManagerData.h.

◆ submitDirMode

SubmitDirMode EL::Detail::ManagerData::submitDirMode {SubmitDirMode::NO_CLOBBER}

the mode with which we handle the submission directory

Definition at line 70 of file ManagerData.h.

@ NO_CLOBBER
create the directory as is, raise an error if it already exists

◆ submitted

bool EL::Detail::ManagerData::submitted {false}

whether we successfully submitted the job in this process

Definition at line 86 of file ManagerData.h.

86{false};

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