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

Go to the source code of this file.

Functions

 ClassImp (EL::TorqueDriver) namespace EL

Function Documentation

◆ ClassImp()

ClassImp ( EL::TorqueDriver )
Author
Nils Krumnack

Definition at line 26 of file TorqueDriver.cxx.

29{
30 void TorqueDriver ::
31 testInvariant () const
32 {
33 RCU_INVARIANT (this != 0);
34 }
35
36
37
38 TorqueDriver ::
39 TorqueDriver ()
40 {
41 RCU_NEW_INVARIANT (this);
42 }
43
44
45
46 ::StatusCode TorqueDriver ::
47 doManagerStep (Detail::ManagerData& data) const
48 {
49 RCU_READ_INVARIANT (this);
50 using namespace msgEventLoop;
51 ANA_CHECK (BatchDriver::doManagerStep (data));
52 switch (data.step)
53 {
54 case Detail::ManagerStep::batchScriptVar:
55 {
56 data.batchJobId = "EL_JOBID=$PBS_ARRAYID\n";
57 }
58 break;
59
60
61 case Detail::ManagerStep::submitJob:
62 case Detail::ManagerStep::doResubmit:
63 {
64 if (data.resubmit)
65 RCU_THROW_MSG ("resubmission not supported for this driver");
66
67 assert (!data.batchJobIndices.empty());
68 assert (data.batchJobIndices.back() + 1 == data.batchJobIndices.size());
69 const std::size_t njob = data.batchJobIndices.size();
70
71 std::ostringstream cmd;
72 cmd << "cd " << data.submitDir << "/submit && qsub "
73 << data.options.castString (Job::optSubmitFlags)
74 << " -t 0-" << (njob-1) << " run";
75 if (gSystem->Exec (cmd.str().c_str()) != 0)
76 RCU_THROW_MSG (("failed to execute: " + cmd.str()).c_str());
77 data.submitted = true;
78 }
79 break;
80
81 default:
82 break;
83 }
84 return ::StatusCode::SUCCESS;
85 }
86}
#define RCU_INVARIANT(x)
Definition Assert.h:201
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233
#define RCU_READ_INVARIANT(x)
Definition Assert.h:229
#define ANA_CHECK(EXP)
check whether the given expression was successful
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define RCU_THROW_MSG(message)
Definition PrintMsg.h:58