Skip to content

Commit 0c9f7ee

Browse files
committed
Sort dirty files
This is a workaround only, only one file should be dirty in this test.
1 parent cbe5863 commit 0c9f7ee

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,24 @@ ADIOS2IOHandlerImpl::flush(internal::ParsedFlushParams &flushParams)
565565
}
566566
}
567567

568+
std::vector<InvalidatableFile const *> sorted;
569+
sorted.reserve(m_dirty.size());
568570
for (auto const &file : m_dirty)
569571
{
570-
auto file_data = m_fileData.find(file);
572+
sorted.emplace_back(&file);
573+
}
574+
std::sort(
575+
sorted.begin(), sorted.end(), [](auto const &left, auto const &right) {
576+
return **left <= **right;
577+
});
578+
579+
for (auto file : sorted)
580+
{
581+
auto file_data = m_fileData.find(*file);
571582
if (file_data == m_fileData.end())
572583
{
573584
throw error::Internal(
574-
"[ADIOS2 backend] No associated data found for file'" + *file +
585+
"[ADIOS2 backend] No associated data found for file'" + **file +
575586
"'.");
576587
}
577588
file_data->second->flush(

0 commit comments

Comments
 (0)