Skip to content

Commit f9d8bc9

Browse files
committed
use function snapshot_fits to check if file is full. Accomodates other file storage types
1 parent e871e77 commit f9d8bc9

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

components/eamxx/src/share/io/scream_io_file_specs.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ struct IOFileSpecs {
8686
// If positive, flush the output file every these many snapshots
8787
int flush_frequency = std::numeric_limits<int>::max();
8888

89-
bool file_is_full () const {
90-
return storage.num_snapshots_in_file>=storage.max_snapshots_in_file;
91-
}
92-
9389
bool file_needs_flush () const {
9490
return storage.num_snapshots_in_file%flush_frequency==0;
9591
}

components/eamxx/src/share/io/scream_output_manager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ void OutputManager::run(const util::TimeStamp& timestamp)
552552
}
553553

554554
// Check if we have hit the max number of snapshots and need to close the file
555-
if (filespecs.file_is_full()) {
555+
bool file_is_full = not filespecs.storage.snapshot_fits(m_output_control.next_write_ts);
556+
if (file_is_full) {
556557
release_file (filespecs.filename);
557558
filespecs.close();
558559
}

0 commit comments

Comments
 (0)