Skip to content

Commit

Permalink
fix loadexternaldata to work since SPIO currently requires the root, …
Browse files Browse the repository at this point in the history
…error if non-root is requested
  • Loading branch information
white238 committed Jan 9, 2025
1 parent e55e10c commit 9c2795c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/axom/sidre/core/MFEMSidreDataCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,16 @@ void MFEMSidreDataCollection::LoadExternalData(const std::string& filename,
const std::string& group_name)
{
// Use the user-provided group name or the DataCollection's base group
Group* grp = m_bp_grp;
Group* grp = m_bp_grp->getDataStore()->getRoot();
if(!group_name.empty())
{
#if defined(AXOM_USE_MPI) && defined(MFEM_USE_MPI)
if(m_comm != MPI_COMM_NULL)
{
SLIC_ERROR("Loading external data with a group name is not supported in parallel.");
}
#endif

SLIC_ERROR_IF(!m_bp_grp->hasGroup(group_name),
axom::fmt::format(
"MFEMSidreDataCollection does not have a Sidre Group '{}'",
Expand All @@ -982,7 +989,6 @@ void MFEMSidreDataCollection::LoadExternalData(const std::string& filename,
// suffix, but the IOManager does not, so it gets added here
using axom::utilities::string::endsWith;
std::string suffixedPath = endsWith(path, ".root") ? path : path + ".root";

IOManager reader(m_comm);
reader.loadExternalData(grp, suffixedPath);
}
Expand Down

0 comments on commit 9c2795c

Please sign in to comment.