Skip to content

Commit ebbb724

Browse files
committed
Sort dirty files
This is a workaround only, only one file should be dirty in this test.
1 parent 753819d commit ebbb724

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,13 +597,24 @@ ADIOS2IOHandlerImpl::flush(internal::ParsedFlushParams &flushParams)
597597
}
598598
}
599599

600+
std::vector<InvalidatableFile const *> sorted;
601+
sorted.reserve(m_dirty.size());
600602
for (auto const &file : m_dirty)
601603
{
602-
auto file_data = m_fileData.find(file);
604+
sorted.emplace_back(&file);
605+
}
606+
std::sort(
607+
sorted.begin(), sorted.end(), [](auto const &left, auto const &right) {
608+
return **left <= **right;
609+
});
610+
611+
for (auto file : sorted)
612+
{
613+
auto file_data = m_fileData.find(*file);
603614
if (file_data == m_fileData.end())
604615
{
605616
throw error::Internal(
606-
"[ADIOS2 backend] No associated data found for file'" + *file +
617+
"[ADIOS2 backend] No associated data found for file'" + **file +
607618
"'.");
608619
}
609620
file_data->second->flush(

0 commit comments

Comments
 (0)