Skip to content

Commit

Permalink
adios2::core::ADIOS: Initialize new IO objects with config file
Browse files Browse the repository at this point in the history
  • Loading branch information
spyridon97 committed Dec 5, 2023
1 parent 08f8995 commit ffc4e49
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/adios2/core/ADIOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,25 @@ IO &ADIOS::DeclareIO(const std::string name, const ArrayOrdering ArrayOrder)
IO &io = ioPair.first->second;
io.SetDeclared();
io.SetArrayOrder(ArrayOrder);

// Configure new IO objects with config file (if present)
if (!m_ConfigFile.empty())
{
if (!adios2sys::SystemTools::FileExists(m_ConfigFile))
{
helper::Throw<std::logic_error>("Core", "ADIOS", "ADIOS",
"config file " + m_ConfigFile + " not found");
}
if (helper::EndsWith(m_ConfigFile, ".xml"))
{
XMLInit(m_ConfigFile);
}
else if (helper::EndsWith(m_ConfigFile, ".yaml") || helper::EndsWith(m_ConfigFile, ".yml"))
{
YAMLInit(m_ConfigFile);
}
}

return io;
}

Expand Down

0 comments on commit ffc4e49

Please sign in to comment.