13int main (
int argc,
char **argv)
15 using namespace asg::msgUserCode;
26 std::string submitDir = argv[1];
27 std::size_t maxIndex = std::stoul (argv[2]);
29 std::ostringstream basedirName;
30 basedirName << submitDir <<
"/tmp";
32 if (gSystem->MakeDirectory (basedirName.str().c_str()) != 0)
33 RCU_THROW_MSG (
"failed to create directory " + basedirName.str());
35 auto submitSingle = [&] (std::size_t
index)
noexcept -> StatusCode
39 std::ostringstream dirName;
40 dirName << basedirName.str() <<
"/" <<
index;
41 if (gSystem->MakeDirectory (dirName.str().c_str()) != 0)
43 ANA_MSG_ERROR (
"failed to create directory " + dirName.str());
44 return StatusCode::FAILURE;
47 std::ostringstream cmd;
48 cmd <<
"cd " << dirName.str() <<
" && ";
51 }
catch (std::exception& e)
54 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
60 if (submitSingle (
index).isFailure())
65 std::ofstream ((submitDir +
"/submitted").c_str());
#define RCU_THROW_MSG(message)
static bool retrieve(const std::string &location)
retrieve all the output for the job in the given location
void exec(const std::string &cmd)
effects: execute the given command guarantee: strong failures: out of memory II failures: system fail...
std::string quote(const std::string &name)
effects: quote the given name to protect it from the shell returns: the quoted name guarantee: strong...
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.