Skip to content

Commit 42270a3

Browse files
committed
Sort dirty files
This is a workaround only, only one file should be dirty in this test.
1 parent e3ec54e commit 42270a3

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
@@ -596,13 +596,24 @@ ADIOS2IOHandlerImpl::flush(internal::ParsedFlushParams &flushParams)
596596
}
597597
}
598598

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

0 commit comments

Comments
 (0)