Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed May 24, 2024
1 parent 067ed06 commit c05d535
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions include/openPMD/LoadStoreChunk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ class ConfigureLoadStore : protected internal::ConfigureLoadStoreData

// @todo rvalue references..?
template <typename T>
auto fromSharedPtr(std::shared_ptr<T>) -> shared_ptr_return_type<T>;
auto withSharedPtr(std::shared_ptr<T>) -> shared_ptr_return_type<T>;
template <typename T>
auto fromUniquePtr(UniquePtrWithLambda<T>) -> unique_ptr_return_type<T>;
auto withUniquePtr(UniquePtrWithLambda<T>) -> unique_ptr_return_type<T>;
template <typename T, typename Del>
auto fromUniquePtr(std::unique_ptr<T, Del>) -> unique_ptr_return_type<T>;
auto withUniquePtr(std::unique_ptr<T, Del>) -> unique_ptr_return_type<T>;
template <typename T>
auto fromRawPtr(T *data) -> shared_ptr_return_type<T>;
auto withRawPtr(T *data) -> shared_ptr_return_type<T>;
template <typename T_ContiguousContainer>
auto fromContiguousContainer(T_ContiguousContainer &data)
auto withContiguousContainer(T_ContiguousContainer &data)
-> std::enable_if_t<
auxiliary::IsContiguousContainer_v<T_ContiguousContainer>,
shared_ptr_return_type<typename T_ContiguousContainer::value_type>>;
Expand Down
14 changes: 7 additions & 7 deletions include/openPMD/LoadStoreChunk.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace openPMD
{
template <typename ChildClass>
template <typename T>
auto ConfigureLoadStore<ChildClass>::fromSharedPtr(std::shared_ptr<T> data)
auto ConfigureLoadStore<ChildClass>::withSharedPtr(std::shared_ptr<T> data)
-> shared_ptr_return_type<T>
{
if (!data)
Expand All @@ -20,7 +20,7 @@ auto ConfigureLoadStore<ChildClass>::fromSharedPtr(std::shared_ptr<T> data)
}
template <typename ChildClass>
template <typename T>
auto ConfigureLoadStore<ChildClass>::fromUniquePtr(UniquePtrWithLambda<T> data)
auto ConfigureLoadStore<ChildClass>::withUniquePtr(UniquePtrWithLambda<T> data)
-> unique_ptr_return_type<T>

{
Expand All @@ -35,7 +35,7 @@ auto ConfigureLoadStore<ChildClass>::fromUniquePtr(UniquePtrWithLambda<T> data)
}
template <typename ChildClass>
template <typename T>
auto ConfigureLoadStore<ChildClass>::fromRawPtr(T *data)
auto ConfigureLoadStore<ChildClass>::withRawPtr(T *data)
-> shared_ptr_return_type<T>
{
if (!data)
Expand All @@ -49,14 +49,14 @@ auto ConfigureLoadStore<ChildClass>::fromRawPtr(T *data)

template <typename ChildClass>
template <typename T, typename Del>
auto ConfigureLoadStore<ChildClass>::fromUniquePtr(std::unique_ptr<T, Del> data)
auto ConfigureLoadStore<ChildClass>::withUniquePtr(std::unique_ptr<T, Del> data)
-> unique_ptr_return_type<T>
{
return fromUniquePtr(UniquePtrWithLambda<T>(std::move(data)));
return withUniquePtr(UniquePtrWithLambda<T>(std::move(data)));
}
template <typename ChildClass>
template <typename T_ContiguousContainer>
auto ConfigureLoadStore<ChildClass>::fromContiguousContainer(
auto ConfigureLoadStore<ChildClass>::withContiguousContainer(
T_ContiguousContainer &data)
-> std::enable_if_t<
auxiliary::IsContiguousContainer_v<T_ContiguousContainer>,
Expand All @@ -66,6 +66,6 @@ auto ConfigureLoadStore<ChildClass>::fromContiguousContainer(
{
m_extent = Extent{data.size()};
}
return fromRawPtr(data.data());
return withRawPtr(data.data());
}
} // namespace openPMD
18 changes: 9 additions & 9 deletions include/openPMD/RecordComponent.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ RecordComponent::loadChunkAllocate_impl(internal::LoadStoreConfig cfg)
prepareLoadStore()
.offset(std::move(o))
.extent(std::move(e))
.fromSharedPtr(newData)
.withSharedPtr(newData)
.enqueueLoad();
return newData;
#else
auto newData = std::shared_ptr<T[]>(new T[numPoints]);
prepareLoadStore()
.offset(std::move(o))
.extent(std::move(e))
.fromSharedPtr(newData)
.withSharedPtr(newData)
.enqueueLoad();
return std::static_pointer_cast<T>(std::move(newData));
#endif
Expand All @@ -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 <typename T_with_extent>
Expand Down Expand Up @@ -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();
}

Expand All @@ -218,7 +218,7 @@ RecordComponent::storeChunk(std::shared_ptr<T> data, Offset o, Extent e)
prepareLoadStore()
.offset(std::move(o))
.extent(std::move(e))
.fromSharedPtr(std::move(data))
.withSharedPtr(std::move(data))
.enqueueStore();
}

Expand All @@ -229,7 +229,7 @@ RecordComponent::storeChunk(UniquePtrWithLambda<T> data, Offset o, Extent e)
prepareLoadStore()
.offset(std::move(o))
.extent(std::move(e))
.fromUniquePtr(std::move(data))
.withUniquePtr(std::move(data))
.enqueueStore();
}

Expand All @@ -240,7 +240,7 @@ RecordComponent::storeChunk(std::unique_ptr<T, Del> data, Offset o, Extent e)
prepareLoadStore()
.offset(std::move(o))
.extent(std::move(e))
.fromUniquePtr(std::move(data))
.withUniquePtr(std::move(data))
.enqueueStore();
}

Expand All @@ -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();
}

Expand All @@ -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 <typename T, typename F>
Expand Down
6 changes: 3 additions & 3 deletions test/ParallelIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,22 +437,22 @@ 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:
// https://github.com/ornladios/ADIOS2/pull/4169
if constexpr (CanTheMemorySelectionBeReset)
{
E_y.prepareLoadStore()
.fromContiguousContainer(ydata_firstandlastrow)
.withContiguousContainer(ydata_firstandlastrow)
.offset({4, 3ul * mpi_rank})
.extent({1, 3})
.enqueueStore();
Expand Down

0 comments on commit c05d535

Please sign in to comment.