Skip to content

Commit 42c39b4

Browse files
committed
Sort dirty files
This is a workaround only, only one file should be dirty in this test.
1 parent 86f1bb3 commit 42c39b4

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

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

0 commit comments

Comments
 (0)