Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/data/sonata_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ void SonataData::record_data(double step, const std::vector<uint64_t>& 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_);
}
}

Expand Down Expand Up @@ -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_);
}
Expand All @@ -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={}, "
Expand Down