From 278a74159159718cb886b17a5869b7c9eb4d057c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Fri, 24 May 2024 17:58:52 +0200 Subject: [PATCH] Renaming --- include/openPMD/LoadStoreChunk.hpp | 10 +++++----- include/openPMD/LoadStoreChunk.tpp | 14 +++++++------- include/openPMD/RecordComponent.tpp | 18 +++++++++--------- test/ParallelIOTest.cpp | 6 +++--- 4 files changed, 24 insertions(+), 24 deletions(-) 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 c5e3a994c8..c02910d9ac 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 @@ -209,7 +209,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(); } @@ -220,7 +220,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(); } @@ -231,7 +231,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(); } @@ -242,7 +242,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(); } @@ -252,7 +252,7 @@ void RecordComponent::storeChunkRaw(T *ptr, Offset offset, Extent extent) prepareLoadStore() .offset(std::move(offset)) .extent(std::move(extent)) - .fromRawPtr(ptr) + .withRawPtr(ptr) .enqueueStore(); } @@ -273,7 +273,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 908ba0689f..ceec580f02 100644 --- a/test/ParallelIOTest.cpp +++ b/test/ParallelIOTest.cpp @@ -440,14 +440,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: @@ -455,7 +455,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();