From 63d09882233bcca30cfc4a76c05e37aa924bbd3a Mon Sep 17 00:00:00 2001 From: Srecko Morovic Date: Tue, 17 Aug 2021 14:22:51 +0200 Subject: [PATCH] new environment variable used to instruct source to start from a specified lumisection. Replaces another unused environment variable which was not used (new name used for backwards compatibility). --- EventFilter/Utilities/interface/EvFDaqDirector.h | 1 + EventFilter/Utilities/src/EvFDaqDirector.cc | 4 ++-- .../Utilities/src/FedRawDataInputSource.cc | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/EventFilter/Utilities/interface/EvFDaqDirector.h b/EventFilter/Utilities/interface/EvFDaqDirector.h index fbc0881ead2d4..2043ce884727e 100644 --- a/EventFilter/Utilities/interface/EvFDaqDirector.h +++ b/EventFilter/Utilities/interface/EvFDaqDirector.h @@ -172,6 +172,7 @@ namespace evf { void createProcessingNotificationMaybe() const; int readLastLSEntry(std::string const& file); unsigned int getLumisectionToStart() const; + unsigned int getStartLumisectionFromEnv() const { return startFromLS_; } void setDeleteTracking(std::mutex* fileDeleteLock, std::list>>* filesToDelete) { fileDeleteLockPtr_ = fileDeleteLock; diff --git a/EventFilter/Utilities/src/EvFDaqDirector.cc b/EventFilter/Utilities/src/EvFDaqDirector.cc index 5943bee8c0c48..1a8aa796e8ed5 100644 --- a/EventFilter/Utilities/src/EvFDaqDirector.cc +++ b/EventFilter/Utilities/src/EvFDaqDirector.cc @@ -123,7 +123,7 @@ namespace evf { socket_ = std::make_unique(io_service_); } - char* startFromLSPtr = std::getenv("FFF_STARTFROMLS"); + char* startFromLSPtr = std::getenv("FFF_START_LUMISECTION"); if (startFromLSPtr) { try { startFromLS_ = boost::lexical_cast(std::string(startFromLSPtr)); @@ -1863,7 +1863,7 @@ namespace evf { std::string fileprefix = run_dir_ + "/" + run_string_ + "_ls"; std::string fullpath; struct stat buf; - unsigned int lscount = startFromLS_; + unsigned int lscount = 1; do { std::stringstream ss; ss << fileprefix << std::setfill('0') << std::setw(4) << lscount << "_EoLS.jsn"; diff --git a/EventFilter/Utilities/src/FedRawDataInputSource.cc b/EventFilter/Utilities/src/FedRawDataInputSource.cc index e39363529cbaa..486b11633c15a 100644 --- a/EventFilter/Utilities/src/FedRawDataInputSource.cc +++ b/EventFilter/Utilities/src/FedRawDataInputSource.cc @@ -921,7 +921,21 @@ void FedRawDataInputSource::readSupervisor() { } else { //new file service if (currentLumiSection == 0 && !alwaysStartFromFirstLS_) { - if (ls < 100) { + if (daqDirector_->getStartLumisectionFromEnv() > 1) { + //start transitions from LS specified by env, continue if not reached + if (ls < daqDirector_->getStartLumisectionFromEnv()) { + //skip file if from earlier LS than specified by env + if (rawFd != -1) { + close(rawFd); + rawFd = -1; + } + status = evf::EvFDaqDirector::noFile; + continue; + } else { + std::unique_ptr inf(new InputFile(evf::EvFDaqDirector::newLumi, ls)); + fileQueue_.push(std::move(inf)); + } + } else if (ls < 100) { //look at last LS file on disk to start from that lumisection (only within first 100 LS) unsigned int lsToStart = daqDirector_->getLumisectionToStart();