Skip to content

Commit

Permalink
Merge pull request #3989 from eisenhauer/BP5LocalOp
Browse files Browse the repository at this point in the history
Fix read request length on BP5 Local arrays with operators
  • Loading branch information
pnorbert committed Jan 9, 2024
2 parents d2a07a2 + 8f40b9b commit 1b5e36b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions source/adios2/toolkit/format/bp5/BP5Deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1577,13 +1577,23 @@ BP5Deserializer::GenerateReadRequests(const bool doAllocTempBuffers, size_t *max
throw std::runtime_error("No data exists for this variable");
if (Req->MemSpace != MemorySpace::Host)
RR.DirectToAppMemory = false;
else if (VarRec->Operator != NULL)
RR.DirectToAppMemory = false;
else
RR.DirectToAppMemory =
IsContiguousTransfer(Req, &writer_meta_base->Offsets[StartDim],
&writer_meta_base->Count[StartDim]);
RR.ReadLength =
helper::GetDataTypeSize(VarRec->Type) *
CalcBlockLength(VarRec->DimCount, &writer_meta_base->Count[StartDim]);
if (VarRec->Operator)
{
// have to have the whole thing
RR.ReadLength = writer_meta_base->DataBlockSize[NeededBlock];
}
else
{
RR.ReadLength =
helper::GetDataTypeSize(VarRec->Type) *
CalcBlockLength(VarRec->DimCount, &writer_meta_base->Count[StartDim]);
}
RR.OffsetInBlock = 0;
if (RR.DirectToAppMemory)
{
Expand Down

0 comments on commit 1b5e36b

Please sign in to comment.