511{
512 using namespace msgEventLoop;
515 {
517 {
518 const std::string jobELGDir =
data.submitDir +
"/elg";
519 const std::string runShFile = jobELGDir + "/runjob.sh";
520
521 const std::string mergeShFile = jobELGDir + "/elg_merge";
522
523
526
527 const std::string jobDefFile = jobELGDir + "/jobdef.root";
528 gSystem->Exec(Form("mkdir -p %s", jobELGDir.c_str()));
529 gSystem->Exec(Form("cp %s %s", runShOrig.c_str(), runShFile.c_str()));
530 gSystem->Exec(Form("chmod +x %s", runShFile.c_str()));
531 gSystem->Exec(Form("cp %s %s", mergeShOrig.c_str(), mergeShFile.c_str()));
532 gSystem->Exec(Form("chmod +x %s", mergeShFile.c_str()));
533
534
536
537 if (listToShipToGrid.size()){
539 "Creating symbolic links for additional files or directories to be sent to grid.\n"
540 "For root or heavy files you should also add their name (not the full path) to EL::Job::optUserFiles.\n"
541 "Otherwise prun ignores those files."
542 );
543
544 std::vector<std::string> vect_filesOrDirToShip;
545 for (
auto&& part : std::views::split(listToShipToGrid,
',')) vect_filesOrDirToShip.emplace_back(
part.begin(),
part.end());
546
547 for (const std::string & fileOrDirToShip: vect_filesOrDirToShip){
548 ANA_MSG_INFO ((
"Creating symbolic link for: " +fileOrDirToShip).c_str());
550 }
552 }
553
554 const SH::SampleHandler&
sh =
data.job->sampleHandler();
555
557 SH::MetaObject& meta = *(*s)->meta();
561 std::string outputSampleName = meta.
castString(
"nc_outputSampleName");
562 if (outputSampleName.empty()) {
563 outputSampleName = "user.%nickname%.%in:name%";
564 }
565 meta.
setString(
"nc_outDS", formatOutputName(meta, outputSampleName));
567 meta.
setString(
"nc_writeInputToTxt",
"IN:input.txt");
569 const std::string execstr = "runjob.sh " + (*s)->name();
571 meta.
setString(
"nc_framework",
"EventLoopGrid");
572 }
573
574 saveJobDef(jobDefFile, *
data.job, sh);
575
577 out !=
data.job->outputEnd(); ++out) {
578 SH::SampleHandler shOut = outputSH(sh,
out->label());
579 shOut.
save(
data.submitDir +
"/output-" +
out->label());
580 }
581 SH::SampleHandler shHist = outputSH(sh, "hist-output");
582 shHist.
save(
data.submitDir +
"/output-hist");
583
585
586 processAllInState(sh, JobState::INIT, 0);
587
588 sh.save(
data.submitDir +
"/input");
589 data.submitted =
true;
590 }
591 break;
592
594 {
596 }
597 break;
598
599 default:
600 (void) true;
601 }
602 return ::StatusCode::SUCCESS;
603}
char data[hepevt_bytes_allocation_ATLAS]
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::string outputFileNames(const EL::Job &job)
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
std::vector< 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...