-Definition at line 151 of file pdi.hpp.
+Definition at line 168 of file pdi.hpp.
diff --git a/pdi_8hpp_source.html b/pdi_8hpp_source.html
index b5ab3f4ef..f6ef6d03c 100644
--- a/pdi_8hpp_source.html
+++ b/pdi_8hpp_source.html
@@ -133,172 +133,189 @@
- 7#include <memory_resource>
-
-
-
-
-
-
-
- 15#include "ddc/chunk_traits.hpp"
- 16#include "ddc/discrete_vector.hpp"
-
-
-
-
- 21static constexpr PDI_inout_t default_access_v
- 22 = (std::is_lvalue_reference_v<T> && !std::is_const_v<std::remove_reference_t<T>>)
-
-
-
-
- 27static constexpr PDI_inout_t chunk_default_access_v = is_writable_chunk_v<T> ? PDI_INOUT : PDI_OUT;
-
-
-
- 31 std::string m_event_name;
-
- 33 std::vector<std::string> m_names;
-
-
- 36 std::pmr::monotonic_buffer_resource m_metadata;
+
+
+
+
+
+
+
+
+
+ 16#include "ddc/chunk_traits.hpp"
+ 17#include "ddc/discrete_vector.hpp"
+
+
+
+
+ 22static constexpr PDI_inout_t default_access_v
+ 23 = (std::is_lvalue_reference_v<T> && !std::is_const_v<std::remove_reference_t<T>>)
+
+
+
+
+ 28static constexpr PDI_inout_t chunk_default_access_v = is_writable_chunk_v<T> ? PDI_INOUT : PDI_OUT;
+
+
+
+ 32 std::string m_event_name;
+
+ 34 std::vector<std::string> m_names;
+
+ 36 std::list<std::any> m_metadata;
-
- 39 explicit PdiEvent(std::string
const& event_name) : m_event_name(event_name) {}
-
-
+ 38 char const* store_name(std::string&& name)
+
+ 40 return m_names.emplace_back(std::move(name)).c_str();
+
-
-
-
-
- 47 PDI_event(m_event_name.c_str());
- 48 for (std::string
const& one_name : m_names) {
- 49 PDI_reclaim(one_name.c_str());
-
-
-
-
+ 43 char const* store_name(std::string
const& name)
+
+ 45 return m_names.emplace_back(name).c_str();
+
+
+
+
+
+ 51 std::any& ref = m_metadata.emplace_back(std::in_place_type<T>, std::move(t));
+ 52 return std::any_cast<T>(&ref);
+
-
-
-
-
-
-
-
-
- 63 std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
- 64 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
-
-
- 67 !(access & PDI_IN) || (chunk_default_access_v<BorrowedChunk> & PDI_IN),
- 68 "Invalid access for constant data");
- 69 auto extents = detail::array(data.domain().extents());
- 70 std::size_t& rank = *std::pmr::polymorphic_allocator<std::size_t>(&m_metadata).allocate(1);
- 71 rank = extents.size();
- 72 PDI_share((name +
"_rank").c_str(), &rank, PDI_OUT);
- 73 m_names.push_back(name +
"_rank");
-
- 75 (name +
"_extents").c_str(),
- 76 std::pmr::vector<std::size_t>(extents.begin(), extents.end(), &m_metadata).data(),
-
- 78 m_names.push_back(name +
"_extents");
-
-
- 81 const_cast<chunk_value_t<BorrowedChunk>*>(data.data_handle()),
-
- 83 m_names.push_back(name);
-
-
-
-
-
-
- 90 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
- 91 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
-
-
- 94 !(access & PDI_IN) || (default_access_v<Arithmetic> & PDI_IN),
- 95 "Invalid access for constant data");
- 96 using value_type = std::remove_cv_t<std::remove_reference_t<Arithmetic>>;
- 97 value_type* data_ptr =
const_cast<value_type*>(&data);
-
- 99 if constexpr (!(access & PDI_IN)) {
- 100 data_ptr = std::pmr::polymorphic_allocator<value_type>(&m_metadata).allocate(1);
-
-
- 103 PDI_share(name.c_str(), data_ptr, access);
- 104 m_names.push_back(name);
-
-
-
- 108 template <PDI_inout_t access,
class T>
-
-
- 111 return with<access>(name, std::forward<T>(t));
-
-
-
-
-
-
-
- 119 template <
class BorrowedChunk, std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
- 120 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
-
- 122 return with<chunk_default_access_v<BorrowedChunk>>(name, std::forward<BorrowedChunk>(data));
+
+ 56 T* store_array(std::vector<T> v)
+
+ 58 std::any& ref = m_metadata.emplace_back(std::in_place_type<std::vector<T>>, std::move(v));
+ 59 return std::any_cast<std::vector<T>>(&ref)->data();
+
+
+
+ 63 explicit PdiEvent(std::string
const& event_name) : m_event_name(event_name) {}
+
+
+
+
+
+
+
+ 71 PDI_event(m_event_name.c_str());
+ 72 for (std::string
const& one_name : m_names) {
+ 73 PDI_reclaim(one_name.c_str());
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 87 std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
+ 88 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
+
+
+ 91 !(access & PDI_IN) || (chunk_default_access_v<BorrowedChunk> & PDI_IN),
+ 92 "Invalid access for constant data");
+ 93 std::array
const extents = detail::array(data.domain().extents());
+ 94 PDI_share(store_name(name +
"_rank"), store_scalar(extents.size()), PDI_OUT);
+
+ 96 store_name(name +
"_extents"),
+ 97 store_array(std::vector<std::size_t>(extents.begin(), extents.end())),
+
+
+
+ 101 const_cast<chunk_value_t<BorrowedChunk>*>(data.data_handle()),
+
+
+
+
+
+
+
+ 109 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
+ 110 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
+
+
+ 113 !(access & PDI_IN) || (default_access_v<Arithmetic> & PDI_IN),
+ 114 "Invalid access for constant data");
+ 115 using value_type = std::remove_cv_t<std::remove_reference_t<Arithmetic>>;
+ 116 value_type* data_ptr =
const_cast<value_type*>(&data);
+
+ 118 if constexpr (!(access & PDI_IN)) {
+ 119 data_ptr = store_scalar(data);
+
+ 121 PDI_share(store_name(name), data_ptr, access);
+
-
-
-
- 128 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
- 129 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
-
- 131 return with<default_access_v<Arithmetic>>(name, std::forward<Arithmetic>(data));
-
-
-
-
-
-
- 138 return with(name, std::forward<T>(t));
-
-
-
-
-
- 144template <PDI_inout_t access,
class DataType>
-
-
- 147 PdiEvent(name
).with<access>(name, std::forward<DataType>(data));
-
-
- 150template <
class DataType>
-
-
- 153 PdiEvent(name
).with(name, std::forward<DataType>(data));
-
-
-
-
+ 125 template <PDI_inout_t access,
class T>
+
+
+ 128 return with<access>(name, std::forward<T>(t));
+
+
+
+
+
+
+
+ 136 template <
class BorrowedChunk, std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
+ 137 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
+
+ 139 return with<chunk_default_access_v<BorrowedChunk>>(name, std::forward<BorrowedChunk>(data));
+
+
+
+
+
+ 145 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
+ 146 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
+
+ 148 return with<default_access_v<Arithmetic>>(name, std::forward<Arithmetic>(data));
+
+
+
+
+
+
+ 155 return with(name, std::forward<T>(t));
+
+
+
+
+
+ 161template <PDI_inout_t access,
class DataType>
+
+
+ 164 PdiEvent(name
).with<access>(name, std::forward<DataType>(data));
+
+
+ 167template <
class DataType>
+
+
+ 170 PdiEvent(name
).with(name, std::forward<DataType>(data));
+
+
+
+
PdiEvent(PdiEvent const &rhs)=delete
-PdiEvent & and_with(std::string const &name, T &&t)
With synonym.
-PdiEvent & and_with(std::string const &name, T &&t)
+PdiEvent & and_with(std::string const &name, T &&t)
With synonym.
+PdiEvent & and_with(std::string const &name, T &&t)
PdiEvent & operator=(PdiEvent &&rhs) noexcept=delete
-
+
PdiEvent & operator=(PdiEvent const &rhs)=delete
-PdiEvent(std::string const &event_name)
-PdiEvent & with(std::string const &name, Arithmetic &&data)
Arithmetic overload.
-PdiEvent & with(std::string const &name, BorrowedChunk &&data)
API with access deduction.
-PdiEvent & with(std::string const &name, Arithmetic &&data)
-PdiEvent & with(std::string const &name, BorrowedChunk &&data)
+PdiEvent(std::string const &event_name)
+PdiEvent & with(std::string const &name, Arithmetic &&data)
Arithmetic overload.
+PdiEvent & with(std::string const &name, BorrowedChunk &&data)
API with access deduction.
+PdiEvent & with(std::string const &name, Arithmetic &&data)
+PdiEvent & with(std::string const &name, BorrowedChunk &&data)
PdiEvent(PdiEvent &&rhs) noexcept=delete
The top-level namespace of DDC.
-void expose_to_pdi(std::string const &name, DataType &&data)
-void expose_to_pdi(std::string const &name, DataType &&data)
+void expose_to_pdi(std::string const &name, DataType &&data)
+void expose_to_pdi(std::string const &name, DataType &&data)