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={}, "