ATLAS Offline Software
Functions
PrunDriver.cxx File Reference
#include <EventLoopGrid/PrunDriver.h>
#include <EventLoop/Algorithm.h>
#include <EventLoop/ManagerData.h>
#include <EventLoop/ManagerStep.h>
#include <EventLoop/Job.h>
#include <EventLoop/MessageCheck.h>
#include <EventLoop/OutputStream.h>
#include <PathResolver/PathResolver.h>
#include <RootCoreUtils/Assert.h>
#include <RootCoreUtils/hadd.h>
#include <RootCoreUtils/ExceptionMsg.h>
#include <RootCoreUtils/ShellExec.h>
#include <SampleHandler/MetaObject.h>
#include <SampleHandler/Sample.h>
#include <SampleHandler/SampleGrid.h>
#include <SampleHandler/SampleHandler.h>
#include <SampleHandler/GridTools.h>
#include <TList.h>
#include <TPython.h>
#include <TROOT.h>
#include <TFile.h>
#include <TSystem.h>
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stdexcept>
#include <boost/algorithm/string.hpp>
#include "pool.h"
#include <mutex>

Go to the source code of this file.

Functions

 ClassImp (EL::PrunDriver) namespace
 
std::string outputFileNames (const EL::Job &job)
 

Function Documentation

◆ ClassImp()

ClassImp ( EL::PrunDriver  )
Author
Alexander Madsen
Nils Krumnack

Definition at line 48 of file PrunDriver.cxx.

50  {
51  namespace JobState {
52  static const unsigned int NSTATES = 6;
53  enum Enum { INIT=0, RUN=1, DOWNLOAD=2, MERGE=3, FINISHED=4, FAILED=5 };
54  static const char* name[NSTATES] =
55  { "INIT", "RUNNING", "DOWNLOAD", "MERGE", "FINISHED", "FAILED" };
56  Enum parse(const std::string& what)
57  {
58  for (unsigned int i = 0; i != NSTATES; ++i) {
59  if (what == name[i]) { return static_cast<Enum>(i); }
60  }
61  RCU_ASSERT0("Failed to parse job state string");
62  throw std::runtime_error("PrunDriver.cxx: Failed to parse job state string"); //compiler dummy
63  }
64  }
65 
66  // When changing the values in the enum make sure
67  // corresponding values in `data/ELG_jediState.py` script
68  // are changed accordingly
69  namespace Status {
70  //static const int NSTATES = 3;
71  enum Enum { DONE=0, PENDING=1, FAIL=2 };
72  }
73 
74  struct TransitionRule {
75  JobState::Enum fromState;
76  Status::Enum status;
77  JobState::Enum toState;
78  TransitionRule(JobState::Enum fromState,
79  Status::Enum status,
80  JobState::Enum toState)
81  : fromState(fromState)
82  , status(status)
83  , toState(toState)
84  {
85  }
86  };
87 
88  struct TmpCd {
89  const std::string origDir;
90  TmpCd(const std::string & dir)
91  : origDir(gSystem->pwd())
92  {
93  gSystem->cd(dir.c_str());
94  }
95  ~TmpCd()
96  {
97  gSystem->cd(origDir.c_str());
98  }
99  };
100 }

◆ outputFileNames()

std::string outputFileNames ( const EL::Job job)

Definition at line 425 of file PrunDriver.cxx.

426 {
427  TList outputs;
428  for (EL::Job::outputIter out = job.outputBegin(),
429  end = job.outputEnd(); out != end; ++out) {
430  outputs.Add(out->Clone());
431  }
432  std::string out = "hist:hist-output.root";
433  TIter itr(&outputs);
434  TObject *obj = 0;
435  while ((obj = itr())) {
436  EL::OutputStream *os = dynamic_cast<EL::OutputStream*>(obj);
437  const std::string name = os->label() + ".root";
438  const std::string ds =
439  os->options()->castString(EL::OutputStream::optContainerSuffix);
440  out += "," + (ds.empty() ? name : ds + ":" + name);
441  }
442  return out;
443 }
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:260
INIT
#define INIT(__TYPE)
offline_EventStorage_v5::FINISHED
@ FINISHED
Definition: v5_DataWriter.h:42
EL::OutputStream
Definition: OutputStream.h:34
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1054
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
internal_poltrig::MERGE
@ MERGE
Definition: PolygonTriangulator.cxx:112
mergePhysValFiles.origDir
origDir
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:24
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
python.CreateTierZeroArgdict.outputs
outputs
Definition: CreateTierZeroArgdict.py:189
beamspotman.dir
string dir
Definition: beamspotman.py:623
python.ExitCodes.what
def what(code)
Definition: ExitCodes.py:73
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EL::OutputStream::optContainerSuffix
static const std::string optContainerSuffix
Definition: OutputStream.h:122
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
RCU_ASSERT0
#define RCU_ASSERT0(y)
Definition: Assert.h:226
merge.status
status
Definition: merge.py:17
test_interactive_athena.job
job
Definition: test_interactive_athena.py:6
python.PyAthena.obj
obj
Definition: PyAthena.py:132
create_dcsc_inputs_sqlite.RUN
int RUN
Definition: create_dcsc_inputs_sqlite.py:45