ATLAS Offline Software
Loading...
Searching...
No Matches
Job.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EVENT_LOOP_JOB_HH
6#define EVENT_LOOP_JOB_HH
7
8//
9// Distributed under the Boost Software License, Version 1.0.
10// (See accompanying file LICENSE_1_0.txt or copy at
11// http://www.boost.org/LICENSE_1_0.txt)
12
13// Please feel free to contact me (krumnack@iastate.edu) for bug
14// reports, feature suggestions, praise and complaints.
15
16
21
22
23
24#include <EventLoop/Global.h>
25
26
27#include <AnaAlgorithm/Global.h>
28#include <EventLoop/JobConfig.h>
31#include <vector>
32#include <memory>
33class AnaReentrantAlgorithmConfig;
34
35namespace asg
36{
37 class AsgServiceConfig;
38}
39
40namespace EL
41{
42 class PythonConfigBase;
43
44
47 void swap (Job& a, Job& b);
48
49
50 class Job
51 {
52 //
53 // public interface
54 //
55
58 public:
59 void testInvariant () const;
60
61
65 public:
66 Job ();
67
68
72 public:
73 Job (const Job& that);
74
75
78 public:
79 ~Job ();
80
81
86 public:
87 Job& operator = (const Job& that);
88
89
93 public:
94 const SH::SampleHandler& sampleHandler () const;
95 void sampleHandler (const SH::SampleHandler& val_sampleHandler);
96
97
102 public:
103 void algsAdd (std::unique_ptr<IAlgorithmWrapper> val_algorithm);
104 void algsAdd (std::unique_ptr<Algorithm> val_algorithm);
105 void algsAdd (Algorithm *alg_swallow);
106 void algsAdd (const AnaAlgorithmConfig& config);
109 void algsAdd (const EL::PythonConfigBase& config);
110
111
122 public:
123 void algsAddClone (const Algorithm& alg);
124
125
128 public:
129 bool algsHas (const std::string& name) const;
130
131
141 public:
143 typedef const OutputStream* outputIter;
145 outputIter outputBegin () const;
147 outputIter outputEnd () const;
148 void outputAdd (const OutputStream& val_output);
149
150
153 public:
154 bool outputHas (const std::string& name) const;
155
156
161 public:
162 void useXAOD ();
163
164
168 public:
170 const SH::MetaObject *options () const;
171
172
176 public:
177 const JobConfig& jobConfig () const noexcept;
178
179
188 public:
190
191
194 public:
195 static const std::string optSubmitDirMode;
196
199 public:
201
202
206
207
211
212
215
217 static const std::string optStreamAliases;
218
219
224 public:
225 static const std::string optMaxEvents;
226
227
232 public:
233 static const std::string optSkipEvents;
234
235
245 public:
247
248
252
258 public:
260
261
273 public:
275
276 public:
287
288
295 public:
296 static const std::string optSubmitFlags;
297
298
301 public:
302 static const std::string optCondorConf;
303
304
311 public:
312 static const std::string optCacheSize;
313
314
326 public:
328
329
336 public:
337 static const std::string optD3PDPerfStats;
338
339
345 public:
346 static const std::string optD3PDReadStats;
347
348
355 public:
356 static const std::string optXAODPerfStats;
357
358
364 public:
365 static const std::string optXAODReadStats;
366
367
375 public:
380
381
387 public:
388 static const std::string optPerfTree;
389
390
392 public:
393 static const std::string optXAODInput;
394
399 public:
404
405 public:
410
411
414 public:
416
417
424 public:
426
427
429 public:
431
432
436 public:
437 static const std::string optResetShell;
438
441 public:
443
451 public:
453
454
456 public:
458
459
461 public:
463
464
468 public:
469 static const std::string optGridDestSE;
470 static const std::string optGridSite;
472 static const std::string optGridNGBPerJob;
473 static const std::string optGridMemory;
475 static const std::string optGridNFiles;
477 static const std::string optGridNJobs;
481 static const std::string optGridExpress;
482 static const std::string optGridNoSubmit;
486 static const std::string optGridShowCmd;
489 static const std::string optGridAvoidVP;
495
499 // (see EventLoopGrid/data/ELG_prun.py script)
501
502 static const std::string optTmpDir;
503 static const std::string optRootVer;
504 static const std::string optCmtConfig;
506 static const std::string optOfficial;
507 static const std::string optVoms;
508
510 static const std::string optGridReporting;
511
514
515 static const std::string optRetries;
516 static const std::string optRetriesWait;
517
519
520
522 static const std::string optUserFiles;
523
524
525
528 public:
538
541 static const std::string optDockerImage;
542
544 static const std::string optDockerOptions;
545
549
554
555
556 public:
559
568
578
586
594
607 static const std::string optMemFailOnLeak;
608
610
611
619
620
621
622 //
623 // private interface
624 //
625
626 friend void swap (Job& a, Job& b);
627
629 private:
630 SH::SampleHandler m_sampleHandler;
631 private:
633 private:
634 SH::MetaObject m_options;
635
637 private:
639 };
640}
641
642#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:39
Definition Job.h:51
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:425
static const std::string optGridShowCmd
Definition Job.h:486
static const std::string optSubmitDirMode
the submit-dir mode (allowed values: "no-clobber", "overwrite", "unique", "unique-link")
Definition Job.h:195
static const std::string optBatchSharedFileSystem
description: batch-specific options rationale: these options are for configuring batch drivers
Definition Job.h:529
static const std::string optEventsPerWorker
description: the name of the option for selecting the number of events per batch job.
Definition Job.h:274
~Job()
effects: standard destructor guarantee: no-fail
Definition Job.cxx:176
EL::JobConfig m_jobConfig
the JobConfig object we use
Definition Job.h:638
void outputAdd(const OutputStream &val_output)
Definition Job.cxx:378
SH::MetaObject * options()
description: the list of options to the job guarantee: no-fail postcondition: result !...
Definition Job.cxx:413
Job & operator=(const Job &that)
effects: standard assignment operator returns: *this guarantee: strong failures: out of memory II
Definition Job.cxx:184
static const std::string optMemFailOnLeak
Failure behaviour of the code when a "significant memory leak" is found.
Definition Job.h:607
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:225
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:500
static const std::string optGridReporting
whether to use grid reporting even when not running on the grid
Definition Job.h:510
static const std::string optCmtConfig
Definition Job.h:504
const SH::SampleHandler & sampleHandler() const
description: the sample handler used guarantee: no-fail / strong failures: out of memory II
Definition Job.cxx:195
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:346
static const std::string optGridExcludedSite
Definition Job.h:471
static const std::string optDockerOptions
any extra options we may want to pass to docker
Definition Job.h:544
static const std::string optGridMergeOutput
Definition Job.h:483
static const std::string optAlgorithmTimer
a boolean flag for whether to add a timer for the algorithms
Definition Job.h:205
SH::MetaObject m_options
Definition Job.h:634
const JobConfig & jobConfig() const noexcept
the JobConfig object we are wrapping
Definition Job.cxx:431
static const std::string optWorkerConfigFile
a python configuration file that will be executed on the worker
Definition Job.h:246
static const std::string optBatchSetupCommand
This overrides the asetup command if you need to use a custom one.
Definition Job.h:537
static const std::string optGridExpress
Definition Job.h:481
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:213
void useXAOD()
effects: register this job to use XAODs guarantee: strong failures: out of memory II failures: TEvent...
Definition Job.cxx:403
static const std::string optMemResidentIncreaseLimit
The minimal resident memory increase necessary to trigger an error.
Definition Job.h:585
static const std::string optXAODPerfStats
description: the name of the option for turning on XAODPerfStats.
Definition Job.h:356
static const std::string optD3PDCacheMinEvent
description: these options configure the D3PDReader TTreeCache settings.
Definition Job.h:376
const OutputStream * outputIter
Definition Job.h:143
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:365
static const std::string optCondorConf
description: the name of the option for supplying extra parameters for condor systems
Definition Job.h:302
static const std::string optXaodAccessMode_athena
Definition Job.h:403
static const std::string optXAODSummaryReport
the option to turn on/off the xAOD summary reporting at the end of the job
Definition Job.h:415
static const std::string optGridMaxWalltime
Definition Job.h:488
static const std::string optBatchConfigFile
the job submission configuration file (used by some drivers that need more complex configuration)
Definition Job.h:548
static const std::string optGridNEventsPerJob
Definition Job.h:480
static const std::string optXaodAccessMode
description: the option to select the access mode for xAODs.
Definition Job.h:400
static const std::string optRetriesWait
Definition Job.h:516
static const std::string optCacheLearnEntries
description: this option allows to configure the number of tree entries used for learning cache behav...
Definition Job.h:327
OutputStream * outputMIter
description: the list of output datasets used guarantee: no-fail / strong failures(3): out of memory ...
Definition Job.h:142
static const std::string optCacheSize
description: this option allows to configure the TTreeCache size for this job.
Definition Job.h:312
SH::SampleHandler m_sampleHandler
description: members directly corresponding to accessors
Definition Job.h:630
static const std::string optGridCpuTimePerEvent
Definition Job.h:487
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
Definition Job.h:296
static const std::string optAlgorithmMemoryMonitor
a boolean flag for whether to add a memory monitor for the algorithms
Definition Job.h:210
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:535
static const std::string optFilesPerWorker
description: the name of the option for selecting the number of files per batch job.
Definition Job.h:259
static const std::string optXAODInput
the option to select whether our input is xAODs
Definition Job.h:393
static const std::string optD3PDPerfStats
description: the name of the option for turning on D3PDPerfStats.
Definition Job.h:337
std::vector< EL::OutputStream > m_output
Definition Job.h:632
static const std::string optMemResidentPerEventIncreaseLimit
The minimal per-event resident memory increase for triggering an error.
Definition Job.h:567
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:452
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:437
bool algsHas(const std::string &name) const
returns: whether we have the algorithm with the given name guarantee: no-fail
Definition Job.cxx:333
static const std::string optGridWorkingGroup
Definition Job.h:485
outputMIter outputEnd()
Definition Job.cxx:360
static const std::string optD3PDCacheMinByteFraction
Definition Job.h:379
static const std::string optDockerImage
this is the name of the docker image, when using docker with a supported batch driver
Definition Job.h:541
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:494
static const std::string optMemVirtualIncreaseLimit
The minimal virtual memory increase necessary to trigger an error.
Definition Job.h:593
static const std::string optGridSite
Definition Job.h:470
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:532
friend void swap(Job &a, Job &b)
effects: standard swap guarantee: no-fail
Definition Job.cxx:135
static const std::string optD3PDCacheMinEventFraction
Definition Job.h:377
static const std::string optVoms
Definition Job.h:507
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
Definition Job.cxx:145
static const std::string optGridAvoidVP
Definition Job.h:489
static const std::string optMemVirtualPerEventIncreaseLimit
The minimal per-event virtual memory increase for triggering an error.
Definition Job.h:577
static const std::string optD3PDCacheMinByte
Definition Job.h:378
static const std::string optGridNFilesPerJob
Definition Job.h:476
static const std::string optWorkerPostClosedOutputsExecutable
Optionnal executable to be provided by the user that will be called, by the worker,...
Definition Job.h:286
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:233
static const std::string optTmpDir
Definition Job.h:502
Job()
effects: standard default constructor guarantee: strong failures: low level errors I
Definition Job.cxx:153
static const std::string optRetries
these options are defined in SH::MetaNames
Definition Job.h:515
static const std::string optGridMemory
Definition Job.h:473
void algsAddClone(const Algorithm &alg)
add a clone of the given algorithm
Definition Job.cxx:324
static const std::string optUniqueDateFormat
the date-format to use when generating unique submission directory names
Definition Job.h:200
static const std::string optStreamAliases
an option for stream aliases
Definition Job.h:217
static const std::string optGridNJobs
Definition Job.h:477
static const std::string optGridDisableAutoRetry
Definition Job.h:505
static const std::string optGridNoSubmit
Definition Job.h:482
static const std::string optGridMaxFileSize
Definition Job.h:478
static const std::string optGridAddNthFieldOfInDSToLFN
Definition Job.h:484
static const std::string optBackgroundProcess
the option to do processing in a background process in PROOF
Definition Job.h:457
static const std::string optGridNFiles
Definition Job.h:475
static const std::string optDisableMetrics
description: the option to turn off collection of performance data
Definition Job.h:430
static const std::string optOfficial
Definition Job.h:506
static const std::string optGridMaxNFilesPerJob
Definition Job.h:479
static const std::string optLocalNoUnsetup
the option not to unsetup the environment in LocalDriver
Definition Job.h:442
static const std::string optFactoryPreload
a boolean flag for whether to perform a component factory preload
Definition Job.h:214
static const std::string optOtherMetaDataTreeNamePattern
Pattern for other MetaData tree name in input xAODs Can be useful for augmented file reading or exclu...
Definition Job.h:409
static const std::string optXaodAccessMode_branch
Definition Job.h:401
static const std::string optXaodAccessMode_class
Definition Job.h:402
outputMIter outputBegin()
Definition Job.cxx:342
static const std::string histogramStreamName
the name of the histogram output stream
Definition Job.h:618
static const std::string optOutputSampleName
the output sample name
Definition Job.h:462
static const std::string optUserFiles
a list of files that need to be available within the worker job
Definition Job.h:522
static const std::string optGridNGBPerJob
Definition Job.h:472
static const std::string optBatchSetupFile
the job submission setup file.
Definition Job.h:553
static const std::string optPerfTree
description: the option to turn on the performance tree in PROOF.
Definition Job.h:388
bool outputHas(const std::string &name) const
returns: whether we have an output with the given name guarantee: no-fail
Definition Job.cxx:388
static const std::string optGridMaxCpuCount
Definition Job.h:474
static const std::string optRemoveSubmitDir
description: the name of the option for overwriting the submission directory.
Definition Job.h:189
static const std::string optGridDestSE
description: grid-specific options rationale: these are named so as to correspond to prun equivalents...
Definition Job.h:469
static const std::string optRootVer
Definition Job.h:503
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:56
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:135
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition PrunDriver.h:15
STL namespace.
#define private