508{
509 using namespace msgEventLoop;
512 {
514 {
515 const std::string jobELGDir =
data.submitDir +
"/elg";
516 const std::string runShFile = jobELGDir + "/runjob.sh";
517
518 const std::string mergeShFile = jobELGDir + "/elg_merge";
519
520
523
524 const std::string jobDefFile = jobELGDir + "/jobdef.root";
525 gSystem->Exec(Form("mkdir -p %s", jobELGDir.c_str()));
526 gSystem->Exec(Form("cp %s %s", runShOrig.c_str(), runShFile.c_str()));
527 gSystem->Exec(Form("chmod +x %s", runShFile.c_str()));
528 gSystem->Exec(Form("cp %s %s", mergeShOrig.c_str(), mergeShFile.c_str()));
529 gSystem->Exec(Form("chmod +x %s", mergeShFile.c_str()));
530
531
533
534 if (listToShipToGrid.size()){
536 "Creating symbolic links for additional files or directories to be sent to grid.\n"
537 "For root or heavy files you should also add their name (not the full path) to EL::Job::optUserFiles.\n"
538 "Otherwise prun ignores those files."
539 );
540
541 std::vector<std::string> vect_filesOrDirToShip;
542 for (
auto&& part : std::views::split(listToShipToGrid,
',')) vect_filesOrDirToShip.emplace_back(
part.begin(),
part.end());
543
544 for (const std::string & fileOrDirToShip: vect_filesOrDirToShip){
545 ANA_MSG_INFO ((
"Creating symbolic link for: " +fileOrDirToShip).c_str());
547 }
549 }
550
551 const SH::SampleHandler&
sh =
data.job->sampleHandler();
552
554 SH::MetaObject& meta = *(*s)->meta();
558 std::string outputSampleName = meta.
castString(
"nc_outputSampleName");
559 if (outputSampleName.empty()) {
560 outputSampleName = "user.%nickname%.%in:name%";
561 }
564 meta.
setString(
"nc_writeInputToTxt",
"IN:input.txt");
566 const std::string execstr = "runjob.sh " + (*s)->name();
568 meta.
setString(
"nc_framework",
"EventLoopGrid");
569 }
570
572
574 out !=
data.job->outputEnd(); ++out) {
575 SH::SampleHandler shOut =
outputSH(sh,
out->label());
576 shOut.
save(
data.submitDir +
"/output-" +
out->label());
577 }
578 SH::SampleHandler shHist =
outputSH(sh,
"hist-output");
579 shHist.
save(
data.submitDir +
"/output-hist");
580
582
584
585 sh.save(
data.submitDir +
"/input");
586 data.submitted =
true;
587 }
588 break;
589
591 {
593 }
594 break;
595
596 default:
597 (void) true;
598 }
599 return ::StatusCode::SUCCESS;
600}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static SH::MetaObject defaultOpts()
static void processAllInState(const SH::SampleHandler &sh, JobState::Enum state, const size_t nThreads)
std::string outputFileNames(const EL::Job &job)
static std::string formatOutputName(const SH::MetaObject &sampleMeta, const std::string &pattern)
static void saveJobDef(const std::string &fileName, const EL::Job &job, const SH::SampleHandler sh)
static SH::SampleHandler outputSH(const SH::SampleHandler &in, const std::string &outputLabel)
virtual::StatusCode doManagerStep(Detail::ManagerData &data) const
const OutputStream * outputIter
static const std::string optGridPrunShipAdditionalFilesOrDirs
Enables to ship additional files to the tarbal sent to the grid Should be a list of comma separated p...
::StatusCode doRetrieve(Detail::ManagerData &data) const
void save(const std::string &directory) const
save the list of samples to the given directory
boost::transform_iterator< SamplePtrToRawSample, std::vector< std::shared_ptr< Sample > >::const_iterator > iterator
the iterator to use
@ doRetrieve
call the actual doRetrieve method
@ submitJob
do the actual job submission
void exec(const std::string &cmd)
effects: execute the given command guarantee: strong failures: out of memory II failures: system fail...