From 5ec62929d8949e4c8689e6f50348e9ad241050a5 Mon Sep 17 00:00:00 2001 From: Ana Gainaru Date: Wed, 11 Sep 2024 09:00:52 -0400 Subject: [PATCH] Merge pull request #4343 from anagainaru/gpuSpan Setting the memory space for Spans to Host (cherry picked from commit d975ac0ae9c0c120efd58db12358890aadab0ead) --- source/adios2/toolkit/format/bp5/BP5Serializer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/adios2/toolkit/format/bp5/BP5Serializer.cpp b/source/adios2/toolkit/format/bp5/BP5Serializer.cpp index f7d82ee16d..5ea891dd48 100644 --- a/source/adios2/toolkit/format/bp5/BP5Serializer.cpp +++ b/source/adios2/toolkit/format/bp5/BP5Serializer.cpp @@ -811,6 +811,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; @@ -880,6 +881,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) @@ -915,7 +917,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*/); } } @@ -959,7 +961,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*/); }