From 81f6e3f91bc1a8c453e2932fff6f34205732e464 Mon Sep 17 00:00:00 2001 From: Jorge Blanco Alonso Date: Fri, 20 Jan 2023 09:45:37 +0100 Subject: [PATCH] Revert "Fix buffering when reporting dt < 0.1 (#35)" This reverts commit 648485ca6c296188869c1f813c96276d355145f3. --- src/data/sonata_data.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/sonata_data.cpp b/src/data/sonata_data.cpp index ee1d6f0..d75dc19 100644 --- a/src/data/sonata_data.cpp +++ b/src/data/sonata_data.cpp @@ -151,7 +151,6 @@ void SonataData::record_data(double step, const std::vector& node_ids) // Increase steps recorded when all nodes from specific rank has been already recorded if (nodes_recorded_.size() == nodes_->size()) { steps_recorded_++; - check_and_write(step * SonataReport::atomic_step_); } } @@ -194,9 +193,8 @@ void SonataData::check_and_write(double timestep) { } if (SonataReport::rank_ == 0) { - logger->debug("UPDATING timestep t={} and rec. steps {} for report {} and population {}", + logger->debug("UPDATING timestep t={} for report {} and population {}", timestep, - steps_recorded_, report_name_, population_name_); } @@ -205,8 +203,10 @@ void SonataData::check_and_write(double timestep) { last_step_recorded_ += reporting_period_ * steps_recorded_; nodes_recorded_.clear(); - // Write when buffer is full or we finish all remaining recordings - if (current_step_ == steps_to_write_ || current_step_ == remaining_steps_) { + // Write when buffer is full, finish all remaining recordings or when record several steps in a + // row + if (current_step_ == steps_to_write_ || current_step_ == remaining_steps_ || + steps_recorded_ > 1) { if (SonataReport::rank_ == 0) { logger->trace( "Writing to file {}! population {} steps_to_write={}, current_step={}, "