diff --git a/first_steps.html b/first_steps.html
index 252da8d1a..eb0979ccf 100644
--- a/first_steps.html
+++ b/first_steps.html
@@ -112,6 +112,10 @@
Once the types are defined, we can start the main
function where we will define our various domains.
int main(int argc, char** argv)
{
+
#ifdef DDC_BUILD_PDI_WRAPPER
+
auto pdi_conf = PC_parse_string("");
+
PDI_init(pdi_conf);
+
#endif
diff --git a/heat_equation.html b/heat_equation.html
index efad5a104..2113a2b73 100644
--- a/heat_equation.html
+++ b/heat_equation.html
@@ -97,238 +97,254 @@
a discrete 65 std::cout << std::setw(6) << temp_slice(ix);
67 std::cout <<
" }" << std::endl;
-
-
-
- 73int main(
int argc,
char** argv)
-
-
-
-
-
-
-
- 82 double const x_start = -1.;
-
- 84 double const x_end = 1.;
-
- 86 size_t const nb_x_points = 10;
-
- 88 double const kx = .01;
-
- 90 double const y_start = -1.;
-
- 92 double const y_end = 1.;
-
- 94 size_t const nb_y_points = 100;
-
- 96 double const ky = .002;
-
- 98 double const start_time = 0.;
-
- 100 double const end_time = 10.;
-
- 102 ptrdiff_t
const t_output_period = 10;
-
-
-
-
-
-
- 114 auto const [x_domain, ghosted_x_domain, x_pre_ghost, x_post_ghost]
-
-
-
-
-
+
+ 69#ifdef DDC_BUILD_PDI_WRAPPER
+
+
+
+
+
+
+
+
+ 80int main(
int argc,
char** argv)
+
+ 82#ifdef DDC_BUILD_PDI_WRAPPER
+ 83 auto pdi_conf = PC_parse_string(
"");
+
+
+
+
+
+
+
+
+ 93 double const x_start = -1.;
+
+ 95 double const x_end = 1.;
+
+ 97 size_t const nb_x_points = 10;
+
+ 99 double const kx = .01;
+
+ 101 double const y_start = -1.;
+
+ 103 double const y_end = 1.;
+
+ 105 size_t const nb_y_points = 100;
+
+ 107 double const ky = .002;
+
+ 109 double const start_time = 0.;
+
+ 111 double const end_time = 10.;
+
+ 113 ptrdiff_t
const t_output_period = 10;
+
+
+
-
-
-
- 126 x_domain_begin(x_domain.front(), x_post_ghost.extents());
-
-
-
- 130 x_domain.back() - x_pre_ghost.extents() + 1,
- 131 x_pre_ghost.extents());
-
-
-
-
-
-
- 140 auto const [y_domain, ghosted_y_domain, y_pre_ghost, y_post_ghost]
-
-
-
-
-
-
-
-
-
- 150 y_domain_begin(y_domain.front(), y_post_ghost.extents());
-
-
-
- 154 y_domain.back() - y_pre_ghost.extents() + 1,
- 155 y_pre_ghost.extents());
+
+
+ 125 auto const [x_domain, ghosted_x_domain, x_pre_ghost, x_post_ghost]
+
+
+
+
+
+
+
+
+
+ 137 x_domain_begin(x_domain.front(), x_post_ghost.extents());
+
+
+
+ 141 x_domain.back() - x_pre_ghost.extents() + 1,
+ 142 x_pre_ghost.extents());
+
+
+
+
+
+
+ 151 auto const [y_domain, ghosted_y_domain, y_pre_ghost, y_post_ghost]
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 180 .5 / (kx * invdx2_max + ky * invdy2_max)};
-
-
-
- 184 std::ceil((end_time - start_time) / max_dt) + .2};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 203 DDimY>(ghosted_x_domain, ghosted_y_domain),
-
-
-
-
-
-
-
- 211 DDimY>(ghosted_x_domain, ghosted_y_domain),
-
-
-
- 217 = ghosted_last_temp.span_view();
-
-
-
-
-
-
-
-
-
- 227 ghosted_initial_temp(ixy)
- 228 = 9.999 * ((x * x + y * y) < 0.25);
-
-
-
-
-
-
- 236 DDimY>(ghosted_x_domain, ghosted_y_domain),
-
-
-
-
-
-
- 244 ghosted_temp[x_domain][y_domain]);
-
-
-
- 250 for (
auto const iter :
-
-
-
-
- 257 ghosted_last_temp[x_pre_ghost][y_domain],
- 258 ghosted_last_temp[y_domain][x_domain_end]);
-
- 260 ghosted_last_temp[y_domain][x_post_ghost],
- 261 ghosted_last_temp[y_domain][x_domain_begin]);
-
- 263 ghosted_last_temp[x_domain][y_pre_ghost],
- 264 ghosted_last_temp[x_domain][y_domain_end]);
-
- 266 ghosted_last_temp[x_domain][y_post_ghost],
- 267 ghosted_last_temp[x_domain][y_domain_begin]);
-
-
-
-
- 274 ghosted_next_temp[x_domain][y_domain]};
-
-
-
-
-
-
-
-
-
-
- 287 = ddc::select<DDimX>(ixy);
-
- 289 = ddc::select<DDimY>(ixy);
-
-
- 292 double const dx_m = 0.5 * (dx_l + dx_r);
-
-
- 295 double const dy_m = 0.5 * (dy_l + dy_r);
- 296 next_temp(ix, iy) = last_temp(ix, iy);
-
- 298 += kx * ddc::step<DDimT>()
- 299 * (dx_l * last_temp(ix + 1, iy)
- 300 - 2.0 * dx_m * last_temp(ix, iy)
- 301 + dx_r * last_temp(ix - 1, iy))
- 302 / (dx_l * dx_m * dx_r);
-
- 304 += ky * ddc::step<DDimT>()
- 305 * (dy_l * last_temp(ix, iy + 1)
- 306 - 2.0 * dy_m * last_temp(ix, iy)
- 307 + dy_r * last_temp(ix, iy - 1))
- 308 / (dy_l * dy_m * dy_r);
-
-
- 313 if (iter - last_output >= t_output_period) {
-
-
-
- 317 ghosted_temp[x_domain][y_domain]);
-
-
-
- 323 std::swap(ghosted_last_temp, ghosted_next_temp);
-
-
- 328 if (last_output < time_domain.
back()) {
-
-
- 331 ghosted_temp[x_domain][y_domain]);
-
-
+
+
+
+ 161 y_domain_begin(y_domain.front(), y_post_ghost.extents());
+
+
+
+ 165 y_domain.back() - y_pre_ghost.extents() + 1,
+ 166 y_pre_ghost.extents());
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 191 .5 / (kx * invdx2_max + ky * invdy2_max)};
+
+
+
+ 195 std::ceil((end_time - start_time) / max_dt) + .2};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 214 DDimY>(ghosted_x_domain, ghosted_y_domain),
+
+
+
+
+
+
+
+ 222 DDimY>(ghosted_x_domain, ghosted_y_domain),
+
+
+
+ 228 = ghosted_last_temp.span_view();
+
+
+
+
+
+
+
+
+
+ 238 ghosted_initial_temp(ixy)
+ 239 = 9.999 * ((x * x + y * y) < 0.25);
+
+
+
+
+
+
+ 247 DDimY>(ghosted_x_domain, ghosted_y_domain),
+
+
+
+
+
+
+ 255 ghosted_temp[x_domain][y_domain]);
+
+
+
+ 261 for (
auto const iter :
+
+
+
+
+ 268 ghosted_last_temp[x_pre_ghost][y_domain],
+ 269 ghosted_last_temp[y_domain][x_domain_end]);
+
+ 271 ghosted_last_temp[y_domain][x_post_ghost],
+ 272 ghosted_last_temp[y_domain][x_domain_begin]);
+
+ 274 ghosted_last_temp[x_domain][y_pre_ghost],
+ 275 ghosted_last_temp[x_domain][y_domain_end]);
+
+ 277 ghosted_last_temp[x_domain][y_post_ghost],
+ 278 ghosted_last_temp[x_domain][y_domain_begin]);
+
+
+
+
+ 285 ghosted_next_temp[x_domain][y_domain]};
+
+
+
+
+
+
+
+
+
+
+ 298 = ddc::select<DDimX>(ixy);
+
+ 300 = ddc::select<DDimY>(ixy);
+
+
+ 303 double const dx_m = 0.5 * (dx_l + dx_r);
+
+
+ 306 double const dy_m = 0.5 * (dy_l + dy_r);
+ 307 next_temp(ix, iy) = last_temp(ix, iy);
+
+ 309 += kx * ddc::step<DDimT>()
+ 310 * (dx_l * last_temp(ix + 1, iy)
+ 311 - 2.0 * dx_m * last_temp(ix, iy)
+ 312 + dx_r * last_temp(ix - 1, iy))
+ 313 / (dx_l * dx_m * dx_r);
+
+ 315 += ky * ddc::step<DDimT>()
+ 316 * (dy_l * last_temp(ix, iy + 1)
+ 317 - 2.0 * dy_m * last_temp(ix, iy)
+ 318 + dy_r * last_temp(ix, iy - 1))
+ 319 / (dy_l * dy_m * dy_r);
+
+
+ 324 if (iter - last_output >= t_output_period) {
+
+
+
+ 328 ghosted_temp[x_domain][y_domain]);
+
+
+
+ 334 std::swap(ghosted_last_temp, ghosted_next_temp);
+
+
+ 339 if (last_output < time_domain.
back()) {
+
+
+ 342 ghosted_temp[x_domain][y_domain]);
+
+
+ 346#ifdef DDC_BUILD_PDI_WRAPPER
+
+ 348 PC_tree_destroy(&pdi_conf);
+
+
Definition: discrete_domain.hpp:48
KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
Definition: discrete_domain.hpp:132
KOKKOS_FUNCTION constexpr DiscreteDomain remove_first(mlength_type n) const
Definition: discrete_domain.hpp:152
@@ -336,6 +352,9 @@ a discrete A DiscreteElement identifies an element of the discrete dimension.
Definition: discrete_element.hpp:145
A DiscreteVector is a vector in the discrete dimension.
Definition: discrete_vector.hpp:251
Definition: kokkos_allocator.hpp:15
+
+PdiEvent & and_with(std::string const &name, T &&t)
Definition: pdi.hpp:84
+PdiEvent & with(std::string const &name, BorrowedChunk &&data)
Definition: pdi.hpp:45
Definition: scope_guard.hpp:14
constexpr parallel_device_policy parallel_device
Definition: for_each.hpp:230
diff --git a/pdi_8hpp_source.html b/pdi_8hpp_source.html
index d5123ac3e..17baa7116 100644
--- a/pdi_8hpp_source.html
+++ b/pdi_8hpp_source.html
@@ -50,144 +50,154 @@ a discrete 2
-
-
-
-
+ 5#include <memory_resource>
+
+
+
- 10#include "ddc/chunk_span.hpp"
+
-
-
-
- 15static constexpr PDI_inout_t default_access_v
- 16 = (std::is_lvalue_reference_v<T> && !std::is_const_v<std::remove_reference_t<T>>)
-
-
-
-
- 21static constexpr PDI_inout_t chunk_default_access_v = is_writable_chunk_v<T> ? PDI_INOUT : PDI_OUT;
+ 12#include "ddc/chunk_span.hpp"
+ 13#include "ddc/discrete_domain.hpp"
+
+
+
+
+ 18static constexpr PDI_inout_t default_access_v
+ 19 = (std::is_lvalue_reference_v<T> && !std::is_const_v<std::remove_reference_t<T>>)
+
+
-
-
-
-
- 27 std::vector<std::string> m_names;
-
-
- 30 PdiEvent(std::string
const& event_name) : m_event(event_name) {}
+
+ 24static constexpr PDI_inout_t chunk_default_access_v = is_writable_chunk_v<T> ? PDI_INOUT : PDI_OUT;
+
+
+
+
+
+ 30 std::vector<std::string> m_names;
-
-
+
+ 33 std::pmr::monotonic_buffer_resource m_metadata;
-
-
-
- 38 std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
- 39 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
-
-
- 42 !(access & PDI_IN) || (chunk_default_access_v<BorrowedChunk> & PDI_IN),
- 43 "Invalid access for constant data");
- 44 auto extents = detail::array(data.domain().extents());
- 45 size_t rank = extents.size();
- 46 PDI_share((name +
"_rank").c_str(), &rank, PDI_OUT);
- 47 m_names.push_back(name +
"_rank");
- 48 PDI_share((name +
"_extents").c_str(), extents.data(), PDI_OUT);
- 49 m_names.push_back(name +
"_extents");
-
-
- 52 const_cast<chunk_value_t<BorrowedChunk>*>(data.data_handle()),
-
- 54 m_names.push_back(name);
-
-
-
-
-
-
- 61 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
- 62 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
-
-
- 65 !(access & PDI_IN) || (default_access_v<Arithmetic> & PDI_IN),
- 66 "Invalid access for constant data");
- 67 using value_type = std::remove_cv_t<std::remove_reference_t<Arithmetic>>;
- 68 PDI_share(name.c_str(),
const_cast<value_type*>(&data), access);
- 69 m_names.push_back(name);
-
-
-
- 73 template <PDI_inout_t access,
class T>
-
-
- 76 return with<access>(name, std::forward<T>(t));
-
-
-
-
-
+
+ 36 PdiEvent(std::string
const& event_name) : m_event(event_name) {}
+
+
+
+
+
+
+
+ 44 std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
+ 45 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
+
+
+ 48 !(access & PDI_IN) || (chunk_default_access_v<BorrowedChunk> & PDI_IN),
+ 49 "Invalid access for constant data");
+ 50 auto extents = detail::array(data.domain().extents());
+ 51 size_t& rank = *std::pmr::polymorphic_allocator<size_t>(&m_metadata).allocate(1);
+ 52 rank = extents.size();
+ 53 PDI_share((name +
"_rank").c_str(), &rank, PDI_OUT);
+ 54 m_names.push_back(name +
"_rank");
+
+ 56 (name +
"_extents").c_str(),
+ 57 std::pmr::vector<size_t>(extents.begin(), extents.end(), &m_metadata).data(),
+
+ 59 m_names.push_back(name +
"_extents");
+
+
+ 62 const_cast<chunk_value_t<BorrowedChunk>*>(data.data_handle()),
+
+ 64 m_names.push_back(name);
+
+
+
+
+
+
+ 71 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
+ 72 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
+
+
+ 75 !(access & PDI_IN) || (default_access_v<Arithmetic> & PDI_IN),
+ 76 "Invalid access for constant data");
+ 77 using value_type = std::remove_cv_t<std::remove_reference_t<Arithmetic>>;
+ 78 PDI_share(name.c_str(),
const_cast<value_type*>(&data), access);
+ 79 m_names.push_back(name);
+
+
-
- 84 template <
class BorrowedChunk, std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
- 85 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
-
- 87 return with<chunk_default_access_v<BorrowedChunk>>(name, std::forward<BorrowedChunk>(data));
-
-
-
-
-
- 93 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
- 94 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
-
- 96 return with<default_access_v<Arithmetic>>(name, std::forward<Arithmetic>(data));
-
-
-
-
-
-
- 103 return with(name, std::forward<T>(t));
-
-
-
-
-
-
- 110 PDI_event(m_event.c_str());
- 111 for (std::string
const& one_name : m_names) {
- 112 PDI_reclaim(one_name.c_str());
-
+ 83 template <PDI_inout_t access,
class T>
+
+
+ 86 return with<access>(name, std::forward<T>(t));
+
+
+
+
+
+
+
+ 94 template <
class BorrowedChunk, std::enable_if_t<is_borrowed_chunk_v<BorrowedChunk>,
int> = 0>
+ 95 PdiEvent&
with(std::string
const& name, BorrowedChunk&& data)
+
+ 97 return with<chunk_default_access_v<BorrowedChunk>>(name, std::forward<BorrowedChunk>(data));
+
+
+
+
+
+ 103 std::enable_if_t<std::is_arithmetic_v<std::remove_reference_t<Arithmetic>>,
int> = 0>
+ 104 PdiEvent&
with(std::string
const& name, Arithmetic&& data)
+
+ 106 return with<default_access_v<Arithmetic>>(name, std::forward<Arithmetic>(data));
+
+
+
+
+
+
+ 113 return with(name, std::forward<T>(t));
-
-
- 117template <PDI_inout_t access,
class DataType>
-
-
- 120 PdiEvent(name
).with<access>(name, std::forward<DataType>(data));
-
-
- 123template <
class DataType>
-
-
- 126 PdiEvent(name
).with(name, std::forward<DataType>(data));
-
-
-
-
-
-PdiEvent & and_with(std::string const &name, T &&t)
With synonym.
Definition: pdi.hpp:101
-PdiEvent & and_with(std::string const &name, T &&t)
Definition: pdi.hpp:74
-~PdiEvent()
Definition: pdi.hpp:108
-PdiEvent(std::string const &event_name)
Definition: pdi.hpp:30
-PdiEvent & with(std::string const &name, Arithmetic &&data)
Arithmetic overload.
Definition: pdi.hpp:94
-PdiEvent & with(std::string const &name, BorrowedChunk &&data)
API with access deduction.
Definition: pdi.hpp:85
-PdiEvent & with(std::string const &name, Arithmetic &&data)
Definition: pdi.hpp:62
-PdiEvent & with(std::string const &name, BorrowedChunk &&data)
Definition: pdi.hpp:39
+
+
+
+
+
+ 120 PDI_event(m_event.c_str());
+ 121 for (std::string
const& one_name : m_names) {
+ 122 PDI_reclaim(one_name.c_str());
+
+
+
+
+ 127template <PDI_inout_t access,
class DataType>
+
+
+ 130 PdiEvent(name
).with<access>(name, std::forward<DataType>(data));
+
+
+ 133template <
class DataType>
+
+
+ 136 PdiEvent(name
).with(name, std::forward<DataType>(data));
+
+
+
+
+
+PdiEvent & and_with(std::string const &name, T &&t)
With synonym.
Definition: pdi.hpp:111
+PdiEvent & and_with(std::string const &name, T &&t)
Definition: pdi.hpp:84
+~PdiEvent()
Definition: pdi.hpp:118
+PdiEvent(std::string const &event_name)
Definition: pdi.hpp:36
+PdiEvent & with(std::string const &name, Arithmetic &&data)
Arithmetic overload.
Definition: pdi.hpp:104
+PdiEvent & with(std::string const &name, BorrowedChunk &&data)
API with access deduction.
Definition: pdi.hpp:95
+PdiEvent & with(std::string const &name, Arithmetic &&data)
Definition: pdi.hpp:72
+PdiEvent & with(std::string const &name, BorrowedChunk &&data)
Definition: pdi.hpp:45
Definition: aligned_allocator.hpp:9
-void expose_to_pdi(std::string const &name, DataType &&data)
Definition: pdi.hpp:118
-void expose_to_pdi(std::string const &name, DataType &&data)
Definition: pdi.hpp:124
+void expose_to_pdi(std::string const &name, DataType &&data)
Definition: pdi.hpp:128
+void expose_to_pdi(std::string const &name, DataType &&data)
Definition: pdi.hpp:134