#include <EventLoop/CondorDriver.h>
#include <AsgMessaging/StatusCode.h>
#include <EventLoop/BatchJob.h>
#include <EventLoop/Job.h>
#include <EventLoop/ManagerData.h>
#include <EventLoop/MessageCheck.h>
#include <RootCoreUtils/Assert.h>
#include <RootCoreUtils/ThrowMsg.h>
#include <TSystem.h>
#include <fstream>
#include <memory>
#include <sstream>
#include <cstdlib>
#include <filesystem>
Go to the source code of this file.
◆ ClassImp()
- Author
- Nils Krumnack
Definition at line 32 of file CondorDriver.cxx.
37 testInvariant ()
const
53 doManagerStep (Detail::ManagerData&
data)
const
56 using namespace msgEventLoop;
60 case Detail::ManagerStep::batchScriptVar:
62 data.batchInit =
"export PATH LD_LIBRARY_PATH PYTHONPATH";
66 case Detail::ManagerStep::submitJob:
67 case Detail::ManagerStep::doResubmit:
70 const std::string tarballName(
"AnalysisPackage.tar.gz");
74 if(!
data.options.castBool(Job::optBatchSharedFileSystem,
true))
76 const std::string newLocation =
data.submitDir +
"/submit/" + tarballName;
77 int status=gSystem->CopyFile(tarballName.c_str(),newLocation.c_str());
79 RCU_THROW_MSG( (
"failed to copy " + tarballName +
" to " + newLocation).c_str() );
84 std::ofstream
file ((
data.submitDir +
"/submit/submit").c_str());
85 file <<
"executable = run\n";
86 file <<
"universe = vanilla\n";
87 file <<
"log = submit/run.log\n";
88 file <<
"output = submit/log-$(Item).out\n";
89 file <<
"error = submit/log-$(Item).err\n";
90 file <<
"initialdir = " <<
data.submitDir <<
"\n";
91 if(!
data.options.castBool(Job::optBatchSharedFileSystem,
true))
93 file <<
"should_transfer_files = YES\n";
94 file <<
"when_to_transfer_output = ON_EXIT\n";
95 file <<
"transfer_input_files = submit/" << tarballName <<
", submit/segments, submit/config.root\n";
96 file <<
"transfer_output_files = fetch, status\n";
97 if (
char* x509userproxy =
std::getenv(
"X509_USER_PROXY")) {
101 proxyPathDestination,
102 std::filesystem::copy_options::overwrite_existing);
103 file <<
"x509userproxy = " << proxyPathDestination.string() <<
"\n";
109 file <<
"arguments = $(Item)\n";
110 file <<
"\n" <<
data.options.castString (Job::optCondorConf) <<
"\n";
111 file <<
"queue in ( ";
113 for (std::size_t
index :
data.batchJobIndices)
125 std::ostringstream
cmd;
126 cmd <<
"cd " <<
data.submitDir <<
"/submit && condor_submit "
127 <<
data.options.castString (Job::optSubmitFlags) <<
" submit";
128 if (gSystem->Exec (
cmd.str().c_str()) != 0)
131 data.submitted =
true;
138 return ::StatusCode::SUCCESS;