diff --git a/include/openPMD/LoadStoreChunk.hpp b/include/openPMD/LoadStoreChunk.hpp index 197e3459fc..864b7f9472 100644 --- a/include/openPMD/LoadStoreChunk.hpp +++ b/include/openPMD/LoadStoreChunk.hpp @@ -99,15 +99,15 @@ class ConfigureLoadStore : protected internal::ConfigureLoadStoreData // @todo rvalue references..? template - auto fromSharedPtr(std::shared_ptr) -> shared_ptr_return_type; + auto withSharedPtr(std::shared_ptr) -> shared_ptr_return_type; template - auto fromUniquePtr(UniquePtrWithLambda) -> unique_ptr_return_type; + auto withUniquePtr(UniquePtrWithLambda) -> unique_ptr_return_type; template - auto fromUniquePtr(std::unique_ptr) -> unique_ptr_return_type; + auto withUniquePtr(std::unique_ptr) -> unique_ptr_return_type; template - auto fromRawPtr(T *data) -> shared_ptr_return_type; + auto withRawPtr(T *data) -> shared_ptr_return_type; template - auto fromContiguousContainer(T_ContiguousContainer &data) + auto withContiguousContainer(T_ContiguousContainer &data) -> std::enable_if_t< auxiliary::IsContiguousContainer_v, shared_ptr_return_type>; diff --git a/include/openPMD/LoadStoreChunk.tpp b/include/openPMD/LoadStoreChunk.tpp index 63b4b14263..f91f61b5e0 100644 --- a/include/openPMD/LoadStoreChunk.tpp +++ b/include/openPMD/LoadStoreChunk.tpp @@ -6,7 +6,7 @@ namespace openPMD { template template -auto ConfigureLoadStore::fromSharedPtr(std::shared_ptr data) +auto ConfigureLoadStore::withSharedPtr(std::shared_ptr data) -> shared_ptr_return_type { if (!data) @@ -20,7 +20,7 @@ auto ConfigureLoadStore::fromSharedPtr(std::shared_ptr data) } template template -auto ConfigureLoadStore::fromUniquePtr(UniquePtrWithLambda data) +auto ConfigureLoadStore::withUniquePtr(UniquePtrWithLambda data) -> unique_ptr_return_type { @@ -35,7 +35,7 @@ auto ConfigureLoadStore::fromUniquePtr(UniquePtrWithLambda data) } template template -auto ConfigureLoadStore::fromRawPtr(T *data) +auto ConfigureLoadStore::withRawPtr(T *data) -> shared_ptr_return_type { if (!data) @@ -49,14 +49,14 @@ auto ConfigureLoadStore::fromRawPtr(T *data) template template -auto ConfigureLoadStore::fromUniquePtr(std::unique_ptr data) +auto ConfigureLoadStore::withUniquePtr(std::unique_ptr data) -> unique_ptr_return_type { - return fromUniquePtr(UniquePtrWithLambda(std::move(data))); + return withUniquePtr(UniquePtrWithLambda(std::move(data))); } template template -auto ConfigureLoadStore::fromContiguousContainer( +auto ConfigureLoadStore::withContiguousContainer( T_ContiguousContainer &data) -> std::enable_if_t< auxiliary::IsContiguousContainer_v, @@ -66,6 +66,6 @@ auto ConfigureLoadStore::fromContiguousContainer( { m_extent = Extent{data.size()}; } - return fromRawPtr(data.data()); + return withRawPtr(data.data()); } } // namespace openPMD diff --git a/include/openPMD/RecordComponent.tpp b/include/openPMD/RecordComponent.tpp index 72241dd1c1..3d5f874736 100644 --- a/include/openPMD/RecordComponent.tpp +++ b/include/openPMD/RecordComponent.tpp @@ -99,7 +99,7 @@ RecordComponent::loadChunkAllocate_impl(internal::LoadStoreConfig cfg) prepareLoadStore() .offset(std::move(o)) .extent(std::move(e)) - .fromSharedPtr(newData) + .withSharedPtr(newData) .enqueueLoad(); return newData; #else @@ -107,7 +107,7 @@ RecordComponent::loadChunkAllocate_impl(internal::LoadStoreConfig cfg) prepareLoadStore() .offset(std::move(o)) .extent(std::move(e)) - .fromSharedPtr(newData) + .withSharedPtr(newData) .enqueueLoad(); return std::static_pointer_cast(std::move(newData)); #endif @@ -134,7 +134,7 @@ inline void RecordComponent::loadChunk( operation.extent(std::move(e)); } - operation.fromSharedPtr(std::move(data)).enqueueLoad(); + operation.withSharedPtr(std::move(data)).enqueueLoad(); } template @@ -207,7 +207,7 @@ inline void RecordComponent::loadChunkRaw(T *ptr, Offset offset, Extent extent) prepareLoadStore() .offset(std::move(offset)) .extent(std::move(extent)) - .fromRawPtr(ptr) + .withRawPtr(ptr) .enqueueLoad(); } @@ -218,7 +218,7 @@ RecordComponent::storeChunk(std::shared_ptr data, Offset o, Extent e) prepareLoadStore() .offset(std::move(o)) .extent(std::move(e)) - .fromSharedPtr(std::move(data)) + .withSharedPtr(std::move(data)) .enqueueStore(); } @@ -229,7 +229,7 @@ RecordComponent::storeChunk(UniquePtrWithLambda data, Offset o, Extent e) prepareLoadStore() .offset(std::move(o)) .extent(std::move(e)) - .fromUniquePtr(std::move(data)) + .withUniquePtr(std::move(data)) .enqueueStore(); } @@ -240,7 +240,7 @@ RecordComponent::storeChunk(std::unique_ptr data, Offset o, Extent e) prepareLoadStore() .offset(std::move(o)) .extent(std::move(e)) - .fromUniquePtr(std::move(data)) + .withUniquePtr(std::move(data)) .enqueueStore(); } @@ -250,7 +250,7 @@ void RecordComponent::storeChunkRaw(T *ptr, Offset offset, Extent extent) prepareLoadStore() .offset(std::move(offset)) .extent(std::move(extent)) - .fromRawPtr(ptr) + .withRawPtr(ptr) .enqueueStore(); } @@ -271,7 +271,7 @@ RecordComponent::storeChunk(T_ContiguousContainer &data, Offset o, Extent e) storeChunkConfig.extent(std::move(e)); } - std::move(storeChunkConfig).fromContiguousContainer(data).enqueueStore(); + std::move(storeChunkConfig).withContiguousContainer(data).enqueueStore(); } template diff --git a/test/ParallelIOTest.cpp b/test/ParallelIOTest.cpp index d7350789f3..5a55990001 100644 --- a/test/ParallelIOTest.cpp +++ b/test/ParallelIOTest.cpp @@ -437,14 +437,14 @@ void available_chunks_test(std::string const &file_ending) auto E_y = it0.meshes["E"]["y"]; E_y.resetDataset({Datatype::INT, {5, 3ul * mpi_size}}); E_y.prepareLoadStore() - .fromContiguousContainer(ydata_firstandlastrow) + .withContiguousContainer(ydata_firstandlastrow) .offset({0, 3ul * mpi_rank}) .extent({1, 3}) .enqueueStore(); E_y.prepareLoadStore() .offset({1, 3ul * mpi_rank}) .extent({3, 3}) - .fromContiguousContainer(ydata) + .withContiguousContainer(ydata) .memorySelection({{1, 1}, {5, 5}}) .enqueueStore(); // if condition checks if this PR is available in ADIOS2: @@ -452,7 +452,7 @@ void available_chunks_test(std::string const &file_ending) if constexpr (CanTheMemorySelectionBeReset) { E_y.prepareLoadStore() - .fromContiguousContainer(ydata_firstandlastrow) + .withContiguousContainer(ydata_firstandlastrow) .offset({4, 3ul * mpi_rank}) .extent({1, 3}) .enqueueStore();