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