ATLAS Offline Software
Loading...
Searching...
No Matches
Job.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#ifndef EVENT_LOOP_JOB_HH
8#define EVENT_LOOP_JOB_HH
9
12
13
14
15#include <EventLoop/Global.h>
16
17
18#include <AnaAlgorithm/Global.h>
19#include <EventLoop/JobConfig.h>
22#include <vector>
23#include <memory>
24class AnaReentrantAlgorithmConfig;
25
26namespace asg
27{
28 class AsgServiceConfig;
29}
30
31namespace EL
32{
33 class PythonConfigBase;
34
35
38 void swap (Job& a, Job& b);
39
40
41 class Job
42 {
43 //
44 // public interface
45 //
46
49 public:
50 void testInvariant () const;
51
52
56 public:
57 Job ();
58
59
63 public:
64 Job (const Job& that);
65
66
69 public:
70 ~Job ();
71
72
77 public:
78 Job& operator = (const Job& that);
79
80
84 public:
85 const SH::SampleHandler& sampleHandler () const;
86 void sampleHandler (const SH::SampleHandler& val_sampleHandler);
87
88
93 public:
94 void algsAdd (std::unique_ptr<IAlgorithmWrapper> val_algorithm);
95 void algsAdd (std::unique_ptr<Algorithm> val_algorithm);
96 void algsAdd (Algorithm *alg_swallow);
97 void algsAdd (const AnaAlgorithmConfig& config);
98 void algsAdd (const AnaReentrantAlgorithmConfig& config);
99 void algsAdd (const asg::AsgServiceConfig& config);
100 void algsAdd (const EL::PythonConfigBase& config);
101
102
113 public:
114 void algsAddClone (const Algorithm& alg);
115
116
119 public:
120 bool algsHas (const std::string& name) const;
121
122
124 public:
125 void startNewAlgSequence ();
126
127
137 public:
139 typedef const OutputStream* outputIter;
141 outputIter outputBegin () const;
143 outputIter outputEnd () const;
144 void outputAdd (const OutputStream& val_output);
145
146
149 public:
150 bool outputHas (const std::string& name) const;
151
152
157 public:
158 void useXAOD ();
159
160
164 public:
166 const SH::MetaObject *options () const;
167
168
172 public:
173 const JobConfig& jobConfig () const noexcept;
174
175
184 public:
186
187
190 public:
191 static const std::string optSubmitDirMode;
192
195 public:
197
198
202
203
207
208
211
213 static const std::string optStreamAliases;
214
215
220 public:
221 static const std::string optMaxEvents;
222
223
228 public:
229 static const std::string optSkipEvents;
230
231
241 public:
243
244
248
254 public:
256
257
269 public:
271
272 public:
283
284
291 public:
292 static const std::string optSubmitFlags;
293
294
297 public:
298 static const std::string optCondorConf;
299
300
307 public:
308 static const std::string optCacheSize;
309
310
322 public:
324
325
332 public:
333 static const std::string optD3PDPerfStats;
334
335
341 public:
342 static const std::string optD3PDReadStats;
343
344
351 public:
352 static const std::string optXAODPerfStats;
353
354
360 public:
361 static const std::string optXAODReadStats;
362
363
371 public:
376
377
383 public:
384 static const std::string optPerfTree;
385
386
388 public:
389 static const std::string optXAODInput;
390
393 public:
395
396
403 public:
405
406
408 public:
410
411
415 public:
416 static const std::string optResetShell;
417
420 public:
422
430 public:
432
433
435 public:
437
438
440 public:
442
443
447 public:
448 static const std::string optGridDestSE;
449 static const std::string optGridSite;
451 static const std::string optGridNGBPerJob;
452 static const std::string optGridMemory;
454 static const std::string optGridNFiles;
456 static const std::string optGridNJobs;
460 static const std::string optGridExpress;
461 static const std::string optGridNoSubmit;
465 static const std::string optGridShowCmd;
468 static const std::string optGridAvoidVP;
474
478 // (see EventLoopGrid/data/ELG_prun.py script)
480
481 static const std::string optTmpDir;
482 static const std::string optRootVer;
483 static const std::string optCmtConfig;
485 static const std::string optOfficial;
486 static const std::string optVoms;
487
489 static const std::string optGridReporting;
490
493
494 static const std::string optRetries;
495 static const std::string optRetriesWait;
496
498
499
501 static const std::string optUserFiles;
502
503
504
507 public:
517
520 static const std::string optDockerImage;
521
523 static const std::string optDockerOptions;
524
528
533
534
535 public:
538
547
557
565
573
586 static const std::string optMemFailOnLeak;
587
589
590
598
599
600
601 //
602 // private interface
603 //
604
605 friend void swap (Job& a, Job& b);
606
608 private:
609 SH::SampleHandler m_sampleHandler;
610 private:
612 private:
613 SH::MetaObject m_options;
614
616 private:
618 };
619}
620
621#endif
static Double_t a
an object that can create a AnaAlgorithm
an object that can create a AnaReentrantAlgorithm
the job configuration that is independent of driver and dataset
Definition JobConfig.h:45
Definition Job.h:42
static const std::string optPrintPerFileStats
description: the option to turn on printing of i/o statistics at the end of each file rationale: whil...
Definition Job.h:404
static const std::string optGridShowCmd
Definition Job.h:465
static const std::string optSubmitDirMode
the submit-dir mode (allowed values: "no-clobber", "overwrite", "unique", "unique-link")
Definition Job.h:191
static const std::string optBatchSharedFileSystem
description: batch-specific options rationale: these options are for configuring batch drivers
Definition Job.h:508
static const std::string optEventsPerWorker
description: the name of the option for selecting the number of events per batch job.
Definition Job.h:270
~Job()
effects: standard destructor guarantee: no-fail
Definition Job.cxx:171
EL::JobConfig m_jobConfig
the JobConfig object we use
Definition Job.h:617
void outputAdd(const OutputStream &val_output)
Definition Job.cxx:382
SH::MetaObject * options()
description: the list of options to the job guarantee: no-fail postcondition: result !...
Definition Job.cxx:417
Job & operator=(const Job &that)
effects: standard assignment operator returns: *this guarantee: strong failures: out of memory II
Definition Job.cxx:179
static const std::string optMemFailOnLeak
Failure behaviour of the code when a "significant memory leak" is found.
Definition Job.h:586
static const std::string optMaxEvents
description: the name of the option used for setting the maximum number of events to process per samp...
Definition Job.h:221
static const std::string optGridPrunNRetrySubmitToGrid
Will retry N-times submission of job to the grid in case of failure to submit job Sometimes submittin...
Definition Job.h:479
static const std::string optGridReporting
whether to use grid reporting even when not running on the grid
Definition Job.h:489
static const std::string optCmtConfig
Definition Job.h:483
const SH::SampleHandler & sampleHandler() const
description: the sample handler used guarantee: no-fail / strong failures: out of memory II
Definition Job.cxx:190
static const std::string optD3PDReadStats
description: the name of the D3PDPerfStats object produced as I gather it, as well as the name of the...
Definition Job.h:342
static const std::string optGridExcludedSite
Definition Job.h:450
static const std::string optDockerOptions
any extra options we may want to pass to docker
Definition Job.h:523
static const std::string optGridMergeOutput
Definition Job.h:462
static const std::string optAlgorithmTimer
a boolean flag for whether to add a timer for the algorithms
Definition Job.h:201
SH::MetaObject m_options
Definition Job.h:613
const JobConfig & jobConfig() const noexcept
the JobConfig object we are wrapping
Definition Job.cxx:435
static const std::string optWorkerConfigFile
a python configuration file that will be executed on the worker
Definition Job.h:242
static const std::string optBatchSetupCommand
This overrides the asetup command if you need to use a custom one.
Definition Job.h:516
static const std::string optGridExpress
Definition Job.h:460
void algsAdd(std::unique_ptr< IAlgorithmWrapper > val_algorithm)
description: the list of algorithms used guarantee: no-fail / strong failures: out of memory II invar...
Definition Job.cxx:208
void useXAOD()
effects: register this job to use XAODs guarantee: strong failures: out of memory II failures: EventS...
Definition Job.cxx:407
static const std::string optMemResidentIncreaseLimit
The minimal resident memory increase necessary to trigger an error.
Definition Job.h:564
static const std::string optXAODPerfStats
description: the name of the option for turning on XAODPerfStats.
Definition Job.h:352
static const std::string optD3PDCacheMinEvent
description: these options configure the D3PDReader TTreeCache settings.
Definition Job.h:372
const OutputStream * outputIter
Definition Job.h:139
static const std::string optXAODReadStats
description: the name of the XAODPerfStats object produced as I gather it, as well as the name of the...
Definition Job.h:361
static const std::string optCondorConf
description: the name of the option for supplying extra parameters for condor systems
Definition Job.h:298
static const std::string optXAODSummaryReport
the option to turn on/off the xAOD summary reporting at the end of the job
Definition Job.h:394
static const std::string optGridMaxWalltime
Definition Job.h:467
static const std::string optBatchConfigFile
the job submission configuration file (used by some drivers that need more complex configuration)
Definition Job.h:527
static const std::string optGridNEventsPerJob
Definition Job.h:459
static const std::string optRetriesWait
Definition Job.h:495
static const std::string optCacheLearnEntries
description: this option allows to configure the number of tree entries used for learning cache behav...
Definition Job.h:323
OutputStream * outputMIter
description: the list of output datasets used guarantee: no-fail / strong failures(3): out of memory ...
Definition Job.h:138
static const std::string optCacheSize
description: this option allows to configure the TTreeCache size for this job.
Definition Job.h:308
SH::SampleHandler m_sampleHandler
description: members directly corresponding to accessors
Definition Job.h:609
static const std::string optGridCpuTimePerEvent
Definition Job.h:466
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
Definition Job.h:292
static const std::string optAlgorithmMemoryMonitor
a boolean flag for whether to add a memory monitor for the algorithms
Definition Job.h:206
static const std::string optBatchSlurmWrapperExec
Append a command before the main executable is called This is useful is you want to execute the comma...
Definition Job.h:514
static const std::string optFilesPerWorker
description: the name of the option for selecting the number of files per batch job.
Definition Job.h:255
static const std::string optXAODInput
the option to select whether our input is xAODs
Definition Job.h:389
static const std::string optD3PDPerfStats
description: the name of the option for turning on D3PDPerfStats.
Definition Job.h:333
std::vector< EL::OutputStream > m_output
Definition Job.h:611
static const std::string optMemResidentPerEventIncreaseLimit
The minimal per-event resident memory increase for triggering an error.
Definition Job.h:546
static const std::string optNumParallelProcs
the option to specify the number of parallel jobs in LocalDriver (0 = number of hardware cores) (defa...
Definition Job.h:431
void startNewAlgSequence()
start a new sub-sequence of algorithms
Definition Job.cxx:337
static const std::string optResetShell
description: the option to reset the shell on the worker nodes rationale: this is currently only used...
Definition Job.h:416
bool algsHas(const std::string &name) const
returns: whether we have the algorithm with the given name guarantee: no-fail
Definition Job.cxx:328
static const std::string optGridWorkingGroup
Definition Job.h:464
outputMIter outputEnd()
Definition Job.cxx:364
static const std::string optD3PDCacheMinByteFraction
Definition Job.h:375
static const std::string optDockerImage
this is the name of the docker image, when using docker with a supported batch driver
Definition Job.h:520
static const std::string optGridPrunShipAdditionalFilesOrDirs
Enables to ship additional files to the tarbal sent to the grid Should be a list of comma separated p...
Definition Job.h:473
static const std::string optMemVirtualIncreaseLimit
The minimal virtual memory increase necessary to trigger an error.
Definition Job.h:572
static const std::string optGridSite
Definition Job.h:449
static const std::string optBatchSlurmExtraConfigLines
The content of this string will be executed in the job script on the worker node before the main exec...
Definition Job.h:511
friend void swap(Job &a, Job &b)
effects: standard swap guarantee: no-fail
Definition Job.cxx:130
static const std::string optD3PDCacheMinEventFraction
Definition Job.h:373
static const std::string optVoms
Definition Job.h:486
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
Definition Job.cxx:140
static const std::string optGridAvoidVP
Definition Job.h:468
static const std::string optMemVirtualPerEventIncreaseLimit
The minimal per-event virtual memory increase for triggering an error.
Definition Job.h:556
static const std::string optD3PDCacheMinByte
Definition Job.h:374
static const std::string optGridNFilesPerJob
Definition Job.h:455
static const std::string optWorkerPostClosedOutputsExecutable
Optionnal executable to be provided by the user that will be called, by the worker,...
Definition Job.h:282
static const std::string optSkipEvents
description: the name of the option used for skipping a certain number of events in the beginning rat...
Definition Job.h:229
static const std::string optTmpDir
Definition Job.h:481
Job()
effects: standard default constructor guarantee: strong failures: low level errors I
Definition Job.cxx:148
static const std::string optRetries
these options are defined in SH::MetaNames
Definition Job.h:494
static const std::string optGridMemory
Definition Job.h:452
void algsAddClone(const Algorithm &alg)
add a clone of the given algorithm
Definition Job.cxx:319
static const std::string optUniqueDateFormat
the date-format to use when generating unique submission directory names
Definition Job.h:196
static const std::string optStreamAliases
an option for stream aliases
Definition Job.h:213
static const std::string optGridNJobs
Definition Job.h:456
static const std::string optGridDisableAutoRetry
Definition Job.h:484
static const std::string optGridNoSubmit
Definition Job.h:461
static const std::string optGridMaxFileSize
Definition Job.h:457
static const std::string optGridAddNthFieldOfInDSToLFN
Definition Job.h:463
static const std::string optBackgroundProcess
the option to do processing in a background process in PROOF
Definition Job.h:436
static const std::string optGridNFiles
Definition Job.h:454
static const std::string optDisableMetrics
description: the option to turn off collection of performance data
Definition Job.h:409
static const std::string optOfficial
Definition Job.h:485
static const std::string optGridMaxNFilesPerJob
Definition Job.h:458
static const std::string optLocalNoUnsetup
the option not to unsetup the environment in LocalDriver
Definition Job.h:421
static const std::string optFactoryPreload
a boolean flag for whether to perform a component factory preload
Definition Job.h:210
outputMIter outputBegin()
Definition Job.cxx:346
static const std::string histogramStreamName
the name of the histogram output stream
Definition Job.h:597
static const std::string optOutputSampleName
the output sample name
Definition Job.h:441
static const std::string optUserFiles
a list of files that need to be available within the worker job
Definition Job.h:501
static const std::string optGridNGBPerJob
Definition Job.h:451
static const std::string optBatchSetupFile
the job submission setup file.
Definition Job.h:532
static const std::string optPerfTree
description: the option to turn on the performance tree in PROOF.
Definition Job.h:384
bool outputHas(const std::string &name) const
returns: whether we have an output with the given name guarantee: no-fail
Definition Job.cxx:392
static const std::string optGridMaxCpuCount
Definition Job.h:453
static const std::string optRemoveSubmitDir
description: the name of the option for overwriting the submission directory.
Definition Job.h:185
static const std::string optGridDestSE
description: grid-specific options rationale: these are named so as to correspond to prun equivalents...
Definition Job.h:448
static const std::string optRootVer
Definition Job.h:482
the base class for the python configuration of any asg::AsgComponent
A class that manages meta-data to be associated with an object.
Definition MetaObject.h:48
A class that manages a list of Sample objects.
an object that can create a AsgService
This module defines the arguments passed from the BATCH driver to the BATCH worker.
void swap(Job &a, Job &b)
effects: standard swap guarantee: no-fail
Definition Job.cxx:130
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition PrunDriver.h:15
STL namespace.
#define private
Definition testRead.cxx:27