35{
36 void CondorDriver ::
37 testInvariant () const
38 {}
39
40
41
42 CondorDriver ::
43 CondorDriver ()
44 {
46 }
47
48
49
50 ::StatusCode CondorDriver ::
51 doManagerStep (Detail::ManagerData& data) const
52 {
54 using namespace msgEventLoop;
55 ANA_CHECK (BatchDriver::doManagerStep (data));
57 {
58 case Detail::ManagerStep::batchScriptVar:
59 {
60 data.batchInit =
"export PATH LD_LIBRARY_PATH PYTHONPATH";
61 }
62 break;
63
64 case Detail::ManagerStep::submitJob:
65 case Detail::ManagerStep::doResubmit:
66 {
67
68 const std::string tarballName("AnalysisPackage.tar.gz");
69
71 {
72 if(!
data.sharedFileSystem)
73 {
74 const std::string newLocation =
data.submitDir +
"/submit/" + tarballName;
75 int status=gSystem->CopyFile(tarballName.c_str(),newLocation.c_str());
76 if(status != 0)
77 {
78 ANA_MSG_ERROR (
"failed to copy " << tarballName <<
" to " << newLocation);
79 return ::StatusCode::FAILURE;
80 }
81 }
82 }
83
84 {
85 std::ofstream
file ((
data.submitDir +
"/submit/submit").c_str());
86 file <<
"executable = run\n";
87 file <<
"universe = vanilla\n";
88 file <<
"log = submit/run.log\n";
89 file <<
"output = submit/log-$(Item).out\n";
90 file <<
"error = submit/log-$(Item).err\n";
91 file <<
"initialdir = " <<
data.submitDir <<
"\n";
92 if(!
data.sharedFileSystem)
93 {
94 file <<
"should_transfer_files = YES\n";
95 file <<
"when_to_transfer_output = ON_EXIT\n";
96 file <<
"transfer_input_files = submit/" << tarballName <<
", submit/segments, submit/config.root\n";
97 file <<
"transfer_output_files = fetch, status\n";
98 if (char* x509userproxy = std::getenv("X509_USER_PROXY")) {
99 std::filesystem::path proxyPath(x509userproxy);
100 std::filesystem::path proxyPathDestination(
data.submitDir +
"/submit/" + proxyPath.filename().string());
101 std::filesystem::copy(proxyPath,
102 proxyPathDestination,
103 std::filesystem::copy_options::overwrite_existing);
104 file <<
"x509userproxy = " << proxyPathDestination.string() <<
"\n";
105 }
106 else {
108 }
109 }
110 file <<
"arguments = $(Item)\n";
111 file <<
"\n" <<
data.options.castString (Job::optCondorConf) <<
"\n";
112 file <<
"queue in ( ";
114 for (std::size_t
index :
data.batchJobIndices)
115 {
116 if (first)
118 else
121 }
123 }
124
125 {
126 std::ostringstream
cmd;
128 <<
data.options.castString (Job::optSubmitFlags) <<
" submit";
129 if (gSystem->Exec (
cmd.str().c_str()) != 0)
130 {
132 return ::StatusCode::FAILURE;
133 }
134 }
135 data.submitted =
true;
136 }
137 break;
138
139 default:
140 break;
141 }
142 return ::StatusCode::SUCCESS;
143 }
144}
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
std::string quote(const std::string &name)
effects: quote the given name to protect it from the shell returns: the quoted name guarantee: strong...