14{
15 using namespace asg::msgUserCode;
17
19
20 if (argc != 3)
21 {
23 return -1;
24 }
25
27 std::size_t maxIndex = std::stoul (argv[2]);
28
29 std::ostringstream basedirName;
31 {
32 if (gSystem->MakeDirectory (basedirName.str().c_str()) != 0)
33 RCU_THROW_MSG (
"failed to create directory " + basedirName.str());
34 }
35 auto submitSingle = [&] (std::size_t
index)
noexcept -> StatusCode
36 {
37 try
38 {
41 if (gSystem->MakeDirectory (
dirName.str().c_str()) != 0)
42 {
44 return StatusCode::FAILURE;
45 }
46
47 std::ostringstream
cmd;
51 } catch (std::exception& e)
52 {
54 return StatusCode::FAILURE;
55 }
56 return StatusCode::SUCCESS;
57 };
59 {
60 if (submitSingle (
index).isFailure())
61 return EXIT_FAILURE;
62 }
63
64
65 std::ofstream ((submitDir + "/submitted").c_str());
67 return 0;
68}
#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.