Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local values block reading #3782

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions source/adios2/toolkit/format/bp5/BP5Deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,18 +1393,33 @@ bool BP5Deserializer::QueueGetSingle(core::VariableBase &variable,
if (VarRec->OrigShapeID == ShapeID::LocalValue)
{
// Shows up as global array with one element per writer rank
for (size_t WriterRank = variable.m_Start[0];
WriterRank < variable.m_Count[0] + variable.m_Start[0];
WriterRank++)
{
(void)GetSingleValueFromMetadata(variable, VarRec, DestData, Step,
WriterRank);
DestData = (char *)DestData +
variable.m_ElementSize; // use variable.m_ElementSize
// because it's the size in local
// memory, VarRec->ElementSize is
// the size in metadata
}
if (variable.m_SelectionType == adios2::SelectionType::BoundingBox) {
for (size_t WriterRank = variable.m_Start[0];
WriterRank < variable.m_Count[0] + variable.m_Start[0];
WriterRank++)
{
(void)GetSingleValueFromMetadata(variable, VarRec, DestData, Step,
WriterRank);
DestData = (char *)DestData +
variable.m_ElementSize; // use variable.m_ElementSize
// because it's the size in local
// memory, VarRec->ElementSize is
// the size in metadata
}

}
else if (variable.m_SelectionType == adios2::SelectionType::WriteBlock)
{
size_t WriterRank = variable.m_BlockID;
(void)GetSingleValueFromMetadata(variable, VarRec, DestData, Step,
WriterRank);
}
else
{
helper::Throw<std::invalid_argument>(
"Toolkit", "format::bp::BP5Deserializer", "QueueGetSingle",
"Unexpected selection type");
}
return false;
}
MemorySpace MemSpace = variable.GetMemorySpace(DestData);
Expand Down