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 ANA_MSG_ERROR (
"failed to create directory " + basedirName.str());
34 return -1;
35 }
36
37 auto submitSingle = [&] (std::size_t
index)
noexcept -> StatusCode
38 {
39 try
40 {
43 if (gSystem->MakeDirectory (
dirName.str().c_str()) != 0)
44 {
46 return StatusCode::FAILURE;
47 }
48
49 std::ostringstream
cmd;
53 } catch (std::exception& e)
54 {
56 return StatusCode::FAILURE;
57 }
58 return StatusCode::SUCCESS;
59 };
61 {
62 if (submitSingle (
index).isFailure())
63 return EXIT_FAILURE;
64 }
65
66
67 std::ofstream ((submitDir + "/submitted").c_str());
69 return 0;
70}
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.