Skip to content
Snippets Groups Projects
Commit aba84def authored by RoccoA97's avatar RoccoA97
Browse files

Write EoLS and EoR files only from main pipeline

parent 4d72a4b3
No related branches found
No related tags found
1 merge request!98Reduce wait time for writing the EoR file
Pipeline #7123172 failed
......@@ -21,7 +21,7 @@ void OutputByOrbitStream::MonitorEndOfRun() {
// An unhandled run just stopped; wait N seconds in case the pipeline is still processing
std::this_thread::sleep_for(std::chrono::seconds(EOR_DELAY_SECS));
// Write EoR file for the most recent run
output_file_handler_.write_EoR_file();
if (output_file_handler_.isMainPipeline()) output_file_handler_.write_EoR_file();
// Update local EoR tag
latest_EoR = current_run_number;
}
......
......@@ -184,7 +184,7 @@ void OutputFileHandler::close_and_rename::operator()() const {
}
if (outputFile.Index() == outputfilehandler_->max_index_per_ls_ &&
outputfilehandler_->getCMSSWHeaders()) { // end of lumisection
outputfilehandler_->getCMSSWHeaders() && mainPipeline_) { // end of lumisection
outputfilehandler_->write_EoLS_file(outputFile.Lumisection());
}
}
......@@ -222,7 +222,7 @@ void OutputFileHandler::write_EoLS_file(uint32_t ls) {
void OutputFileHandler::write_EoR_file() {
assert(current_index_ > 0 && nOrbitsPerFile_ > 0);
int ls = int(1) + (current_index_ * nOrbitsPerFile_) / constants::N_orbits_per_lumisection;
write_EoLS_file(ls);
if (mainPipeline_) write_EoLS_file(ls);
std::stringstream EoR_filename;
EoR_filename << run_dir_ << "/"
<< "run" << std::setfill('0') << std::setw(6) << current_run_number_
......
......@@ -28,6 +28,7 @@ class OutputFileHandler {
close_and_rename_(base_path_, num_orbits_per_file),
nOrbitsPerFile_(num_orbits_per_file),
cmsswHeaders_(has_cmssw_headers),
mainPipeline_(filename_suffix_==".raw" ? true : false),
sourceID_(source_id),
t{},
max_index_per_ls_(
......@@ -70,6 +71,8 @@ class OutputFileHandler {
void write_EoR_file();
int NOrbitsPerFile() const { return nOrbitsPerFile_; }
bool isMainPipeline() const { return mainPipeline_; }
class close_and_rename {
OutputFileHandler *outputfilehandler_{};
......@@ -123,6 +126,7 @@ class OutputFileHandler {
close_and_rename close_and_rename_;
int nOrbitsPerFile_;
const bool cmsswHeaders_;
const bool mainPipeline_;
int sourceID_;
std::thread t;
const uint32_t max_index_per_ls_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment