Skip to content

Commit

Permalink
Bugfix: Consider dirty upon touch() only in write modes
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Dec 13, 2024
1 parent 6285d5b commit 01cf39b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/IO/ADIOS/ADIOS2IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,15 @@ void ADIOS2IOHandlerImpl::touch(
Writable *writable, Parameter<Operation::TOUCH> const &)
{
auto file = refreshFileFromParent(writable, /* preferParentFile = */ false);
m_dirty.emplace(std::move(file));
if (access::write(m_handler->m_backendAccess))
{
m_dirty.emplace(std::move(file));
}
else if (m_fileData.find(file) == m_fileData.end())
{
throw error::Internal(
"ADIOS2: Tried activating a file that is not open.");
}
}

adios2::Mode ADIOS2IOHandlerImpl::adios2AccessMode(
Expand Down
10 changes: 9 additions & 1 deletion src/IO/JSON/JSONIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,15 @@ void JSONIOHandlerImpl::touch(
Writable *writable, Parameter<Operation::TOUCH> const &)
{
auto file = refreshFileFromParent(writable);
m_dirty.emplace(std::move(file));
if (access::write(m_handler->m_backendAccess))
{
m_dirty.emplace(std::move(file));
}
else if (m_jsonVals.find(file) == m_jsonVals.end())
{
throw error::Internal(
"ADIOS2: Tried activating a file that is not open.");
}
}

auto JSONIOHandlerImpl::getFilehandle(File const &fileName, Access access)
Expand Down

0 comments on commit 01cf39b

Please sign in to comment.