ATLAS Offline Software
Loading...
Searching...
No Matches
GEDriver.cxx File Reference
#include <EventLoop/GEDriver.h>
#include <AsgMessaging/StatusCode.h>
#include <EventLoop/Job.h>
#include <EventLoop/ManagerData.h>
#include <EventLoop/MessageCheck.h>
#include <RootCoreUtils/ShellExec.h>
#include <TSystem.h>
#include <sstream>
Include dependency graph for GEDriver.cxx:

Go to the source code of this file.

Functions

 ClassImp (EL::GEDriver) namespace EL

Function Documentation

◆ ClassImp()

ClassImp ( EL::GEDriver )
Author
Nils Krumnack

Definition at line 26 of file GEDriver.cxx.

29{
30 void GEDriver ::
31 testInvariant () const
32 {}
33
34
35
36 GEDriver ::
37 GEDriver ()
38 {
39 RCU_NEW_INVARIANT (this);
40 }
41
42
43
44 ::StatusCode GEDriver ::
45 doManagerStep (Detail::ManagerData& data) const
46 {
47 RCU_READ_INVARIANT (this);
48 using namespace msgEventLoop;
49 ANA_CHECK (BatchDriver::doManagerStep (data));
50 switch (data.step)
51 {
52 case Detail::ManagerStep::submitJob:
53 case Detail::ManagerStep::doResubmit:
54 {
55 // safely ignoring: resubmit
56
57 std::ostringstream cmd;
58 cmd << "cd " << RCU::Shell::quote (data.submitDir) << "/submit";
59 for (std::size_t iter : data.batchJobIndices)
60 {
61 cmd << " && qsub " << data.options.castString (Job::optSubmitFlags)
62 << " -o " << RCU::Shell::quote (data.submitDir) << "/submit/log-" << iter << ".out"
63 << " -e " << RCU::Shell::quote (data.submitDir) << "/submit/log-" << iter << ".err"
64 << " run " << iter;
65 }
66 if (gSystem->Exec (cmd.str().c_str()) != 0)
67 {
68 ANA_MSG_ERROR ("failed to execute: " << cmd.str());
69 return ::StatusCode::FAILURE;
70 }
71 data.submitted = true;
72 }
73 break;
74
75 default:
76 break;
77 }
78 return ::StatusCode::SUCCESS;
79 }
80}
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:221
#define RCU_READ_INVARIANT(x)
Definition Assert.h:217
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
std::string quote(const std::string &name)
effects: quote the given name to protect it from the shell returns: the quoted name guarantee: strong...
Definition ShellExec.cxx:65