Skip to content

Commit

Permalink
Setting the memory space for allocated spans to Host
Browse files Browse the repository at this point in the history
  • Loading branch information
anagainaru committed Sep 11, 2024
1 parent 4c05ba9 commit 5a99c80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/adios2/toolkit/format/bp5/BP5Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ void BP5Serializer::Marshal(void *Variable, const char *Name, const DataType Typ
else
{
MemorySpace MemSpace = VB->GetMemorySpace(Data);
MemorySpace spanMemSpace = MemSpace;
MetaArrayRec *MetaEntry = (MetaArrayRec *)((char *)(MetadataBuf) + Rec->MetaOffset);
size_t ElemCount = CalcSize(DimCount, Count);
size_t DataOffset = 0;
Expand Down Expand Up @@ -884,6 +885,7 @@ void BP5Serializer::Marshal(void *Variable, const char *Name, const DataType Typ
{
*Span = CurDataBuffer->Allocate(ElemCount * ElemSize, ElemSize);
DataOffset = m_PriorDataBufferSizeTotal + Span->globalPos;
spanMemSpace = MemorySpace::Host;
}

if (!AlreadyWritten)
Expand Down Expand Up @@ -919,7 +921,7 @@ void BP5Serializer::Marshal(void *Variable, const char *Name, const DataType Typ
}
else
{
lf_QueueSpanMinMax(*Span, ElemCount, (DataType)Rec->Type, MemSpace,
lf_QueueSpanMinMax(*Span, ElemCount, (DataType)Rec->Type, spanMemSpace,
Rec->MetaOffset, Rec->MinMaxOffset, 0 /*BlockNum*/);
}
}
Expand Down Expand Up @@ -963,7 +965,7 @@ void BP5Serializer::Marshal(void *Variable, const char *Name, const DataType Typ
}
else
{
lf_QueueSpanMinMax(*Span, ElemCount, (DataType)Rec->Type, MemSpace,
lf_QueueSpanMinMax(*Span, ElemCount, (DataType)Rec->Type, spanMemSpace,
Rec->MetaOffset, Rec->MinMaxOffset,
MetaEntry->BlockCount - 1 /*BlockNum*/);
}
Expand Down

0 comments on commit 5a99c80

Please sign in to comment.