510{
511 using namespace msgEventLoop;
514 {
516 {
517 const std::string jobELGDir =
data.submitDir +
"/elg";
518 const std::string runShFile = jobELGDir + "/runjob.sh";
519
520 const std::string mergeShFile = jobELGDir + "/elg_merge";
521
522
525
526 const std::string jobDefFile = jobELGDir + "/jobdef.root";
527 gSystem->Exec(Form("mkdir -p %s", jobELGDir.c_str()));
528 gSystem->Exec(Form("cp %s %s", runShOrig.c_str(), runShFile.c_str()));
529 gSystem->Exec(Form("chmod +x %s", runShFile.c_str()));
530 gSystem->Exec(Form("cp %s %s", mergeShOrig.c_str(), mergeShFile.c_str()));
531 gSystem->Exec(Form("chmod +x %s", mergeShFile.c_str()));
532
533
535
536 if (listToShipToGrid.size()){
538 "Creating symbolic links for additional files or directories to be sent to grid.\n"
539 "For root or heavy files you should also add their name (not the full path) to EL::Job::optUserFiles.\n"
540 "Otherwise prun ignores those files."
541 );
542
543 std::vector<std::string> vect_filesOrDirToShip;
544 for (
auto&& part : std::views::split(listToShipToGrid,
',')) vect_filesOrDirToShip.emplace_back(
part.begin(),
part.end());
545
546 for (const std::string & fileOrDirToShip: vect_filesOrDirToShip){
547 ANA_MSG_INFO ((
"Creating symbolic link for: " +fileOrDirToShip).c_str());
549 }
551 }
552
553 const SH::SampleHandler&
sh =
data.job->sampleHandler();
554
556 SH::MetaObject& meta = *(*s)->meta();
560 std::string outputSampleName = meta.
castString(
"nc_outputSampleName");
561 if (outputSampleName.empty()) {
562 outputSampleName = "user.%nickname%.%in:name%";
563 }
566 meta.
setString(
"nc_writeInputToTxt",
"IN:input.txt");
568 const std::string execstr = "runjob.sh " + (*s)->name();
570 meta.
setString(
"nc_framework",
"EventLoopGrid");
571 }
572
574
576 out !=
data.job->outputEnd(); ++out) {
577 SH::SampleHandler shOut =
outputSH(sh,
out->label());
578 shOut.
save(
data.submitDir +
"/output-" +
out->label());
579 }
580 SH::SampleHandler shHist =
outputSH(sh,
"hist-output");
581 shHist.
save(
data.submitDir +
"/output-hist");
582
584
586
587 sh.save(
data.submitDir +
"/input");
588 data.submitted =
true;
589 }
590 break;
591
593 {
595 }
596 break;
597
598 default:
599 (void) true;
600 }
601 return ::StatusCode::SUCCESS;
602}
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...