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
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);
107 void algsAdd (const AnaReentrantAlgorithmConfig& config);
108 void algsAdd (const asg::AsgServiceConfig& 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
133 public:
134 void startNewAlgSequence ();
135
136
146 public:
148 typedef const OutputStream* outputIter;
150 outputIter outputBegin () const;
152 outputIter outputEnd () const;
153 void outputAdd (const OutputStream& val_output);
154
155
158 public:
159 bool outputHas (const std::string& name) const;
160
161
166 public:
167 void useXAOD ();
168
169
173 public:
175 const SH::MetaObject *options () const;
176
177
181 public:
182 const JobConfig& jobConfig () const noexcept;
183
184
193 public:
195
196
199 public:
200 static const std::string optSubmitDirMode;
201
204 public:
206
207
211
212
216
217
220
222 static const std::string optStreamAliases;
223
224
229 public:
230 static const std::string optMaxEvents;
231
232
237 public:
238 static const std::string optSkipEvents;
239
240
250 public:
252
253
257
263 public:
265
266
278 public:
280
281 public:
292
293
300 public:
301 static const std::string optSubmitFlags;
302
303
306 public:
307 static const std::string optCondorConf;
308
309
316 public:
317 static const std::string optCacheSize;
318
319
331 public:
333
334
341 public:
342 static const std::string optD3PDPerfStats;
343
344
350 public:
351 static const std::string optD3PDReadStats;
352
353
360 public:
361 static const std::string optXAODPerfStats;
362
363
369 public:
370 static const std::string optXAODReadStats;
371
372
380 public:
385
386
392 public:
393 static const std::string optPerfTree;
394
395
397 public:
398 static const std::string optXAODInput;
399
402 public:
404
405
412 public:
414
415
417 public:
419
420
424 public:
425 static const std::string optResetShell;
426
429 public:
431
439 public:
441
442
444 public:
446
447
449 public:
451
452
456 public:
457 static const std::string optGridDestSE;
458 static const std::string optGridSite;
460 static const std::string optGridNGBPerJob;
461 static const std::string optGridMemory;
463 static const std::string optGridNFiles;
465 static const std::string optGridNJobs;
469 static const std::string optGridExpress;
470 static const std::string optGridNoSubmit;
474 static const std::string optGridShowCmd;
477 static const std::string optGridAvoidVP;
483
487 // (see EventLoopGrid/data/ELG_prun.py script)
489
490 static const std::string optTmpDir;
491 static const std::string optRootVer;
492 static const std::string optCmtConfig;
494 static const std::string optOfficial;
495 static const std::string optVoms;
496
498 static const std::string optGridReporting;
499
502
503 static const std::string optRetries;
504 static const std::string optRetriesWait;
505
507
508
510 static const std::string optUserFiles;
511
512
513
516 public:
526
529 static const std::string optDockerImage;
530
532 static const std::string optDockerOptions;
533
537
542
543
544 public:
547
556
566
574
582
595 static const std::string optMemFailOnLeak;
596
598
599
607
608
609
610 //
611 // private interface
612 //
613
614 friend void swap (Job& a, Job& b);
615
617 private:
618 SH::SampleHandler m_sampleHandler;
619 private:
621 private:
622 SH::MetaObject m_options;
623
625 private:
627 };
628}
629
630#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: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:413
static const std::string optGridShowCmd
Definition Job.h:474
static const std::string optSubmitDirMode
the submit-dir mode (allowed values: "no-clobber", "overwrite", "unique", "unique-link")
Definition Job.h:200
static const std::string optBatchSharedFileSystem
description: batch-specific options rationale: these options are for configuring batch drivers
Definition Job.h:517
static const std::string optEventsPerWorker
description: the name of the option for selecting the number of events per batch job.
Definition Job.h:279
~Job()
effects: standard destructor guarantee: no-fail
Definition Job.cxx:171
EL::JobConfig m_jobConfig
the JobConfig object we use
Definition Job.h:626
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:595
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:230
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:488
static const std::string optGridReporting
whether to use grid reporting even when not running on the grid
Definition Job.h:498
static const std::string optCmtConfig
Definition Job.h:492
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:351
static const std::string optGridExcludedSite
Definition Job.h:459
static const std::string optDockerOptions
any extra options we may want to pass to docker
Definition Job.h:532
static const std::string optGridMergeOutput
Definition Job.h:471
static const std::string optAlgorithmTimer
a boolean flag for whether to add a timer for the algorithms
Definition Job.h:210
SH::MetaObject m_options
Definition Job.h:622
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:251
static const std::string optBatchSetupCommand
This overrides the asetup command if you need to use a custom one.
Definition Job.h:525
static const std::string optGridExpress
Definition Job.h:469
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:573
static const std::string optXAODPerfStats
description: the name of the option for turning on XAODPerfStats.
Definition Job.h:361
static const std::string optD3PDCacheMinEvent
description: these options configure the D3PDReader TTreeCache settings.
Definition Job.h:381
const OutputStream * outputIter
Definition Job.h:148
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:370
static const std::string optCondorConf
description: the name of the option for supplying extra parameters for condor systems
Definition Job.h:307
static const std::string optXAODSummaryReport
the option to turn on/off the xAOD summary reporting at the end of the job
Definition Job.h:403
static const std::string optGridMaxWalltime
Definition Job.h:476
static const std::string optBatchConfigFile
the job submission configuration file (used by some drivers that need more complex configuration)
Definition Job.h:536
static const std::string optGridNEventsPerJob
Definition Job.h:468
static const std::string optRetriesWait
Definition Job.h:504
static const std::string optCacheLearnEntries
description: this option allows to configure the number of tree entries used for learning cache behav...
Definition Job.h:332
OutputStream * outputMIter
description: the list of output datasets used guarantee: no-fail / strong failures(3): out of memory ...
Definition Job.h:147
static const std::string optCacheSize
description: this option allows to configure the TTreeCache size for this job.
Definition Job.h:317
SH::SampleHandler m_sampleHandler
description: members directly corresponding to accessors
Definition Job.h:618
static const std::string optGridCpuTimePerEvent
Definition Job.h:475
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
Definition Job.h:301
static const std::string optAlgorithmMemoryMonitor
a boolean flag for whether to add a memory monitor for the algorithms
Definition Job.h:215
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:523
static const std::string optFilesPerWorker
description: the name of the option for selecting the number of files per batch job.
Definition Job.h:264
static const std::string optXAODInput
the option to select whether our input is xAODs
Definition Job.h:398
static const std::string optD3PDPerfStats
description: the name of the option for turning on D3PDPerfStats.
Definition Job.h:342
std::vector< EL::OutputStream > m_output
Definition Job.h:620
static const std::string optMemResidentPerEventIncreaseLimit
The minimal per-event resident memory increase for triggering an error.
Definition Job.h:555
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:440
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:425
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:473
outputMIter outputEnd()
Definition Job.cxx:364
static const std::string optD3PDCacheMinByteFraction
Definition Job.h:384
static const std::string optDockerImage
this is the name of the docker image, when using docker with a supported batch driver
Definition Job.h:529
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:482
static const std::string optMemVirtualIncreaseLimit
The minimal virtual memory increase necessary to trigger an error.
Definition Job.h:581
static const std::string optGridSite
Definition Job.h:458
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:520
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:382
static const std::string optVoms
Definition Job.h:495
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:477
static const std::string optMemVirtualPerEventIncreaseLimit
The minimal per-event virtual memory increase for triggering an error.
Definition Job.h:565
static const std::string optD3PDCacheMinByte
Definition Job.h:383
static const std::string optGridNFilesPerJob
Definition Job.h:464
static const std::string optWorkerPostClosedOutputsExecutable
Optionnal executable to be provided by the user that will be called, by the worker,...
Definition Job.h:291
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:238
static const std::string optTmpDir
Definition Job.h:490
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:503
static const std::string optGridMemory
Definition Job.h:461
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:205
static const std::string optStreamAliases
an option for stream aliases
Definition Job.h:222
static const std::string optGridNJobs
Definition Job.h:465
static const std::string optGridDisableAutoRetry
Definition Job.h:493
static const std::string optGridNoSubmit
Definition Job.h:470
static const std::string optGridMaxFileSize
Definition Job.h:466
static const std::string optGridAddNthFieldOfInDSToLFN
Definition Job.h:472
static const std::string optBackgroundProcess
the option to do processing in a background process in PROOF
Definition Job.h:445
static const std::string optGridNFiles
Definition Job.h:463
static const std::string optDisableMetrics
description: the option to turn off collection of performance data
Definition Job.h:418
static const std::string optOfficial
Definition Job.h:494
static const std::string optGridMaxNFilesPerJob
Definition Job.h:467
static const std::string optLocalNoUnsetup
the option not to unsetup the environment in LocalDriver
Definition Job.h:430
static const std::string optFactoryPreload
a boolean flag for whether to perform a component factory preload
Definition Job.h:219
outputMIter outputBegin()
Definition Job.cxx:346
static const std::string histogramStreamName
the name of the histogram output stream
Definition Job.h:606
static const std::string optOutputSampleName
the output sample name
Definition Job.h:450
static const std::string optUserFiles
a list of files that need to be available within the worker job
Definition Job.h:510
static const std::string optGridNGBPerJob
Definition Job.h:460
static const std::string optBatchSetupFile
the job submission setup file.
Definition Job.h:541
static const std::string optPerfTree
description: the option to turn on the performance tree in PROOF.
Definition Job.h:393
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:462
static const std::string optRemoveSubmitDir
description: the name of the option for overwriting the submission directory.
Definition Job.h:194
static const std::string optGridDestSE
description: grid-specific options rationale: these are named so as to correspond to prun equivalents...
Definition Job.h:457
static const std::string optRootVer
Definition Job.h:491
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: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