ddc icon indicating copy to clipboard operation
ddc copied to clipboard

Add concept documentation

Open thierryantoun opened this issue 1 year ago • 3 comments

This PR aims to start concept documentation for DDC.

thierryantoun avatar Jul 10 '24 21:07 thierryantoun

I think it may be useful for a new user coming from Fortran or Kokkos to understand how the memory layouts of the Chunks are determined with DDC.

In fact it is determined by the order of domains passed to a multidimensional DiscreteDomain constructor. The rightest is the most contiguous:

DiscreteDomain<Tag1, Tag2> domain(dom1, dom2); // Cartesian product of dom1 and dom2
ddc::Chunk<double> chunk(domain); // Tag2 is the contiguous dimension

Afterward, maybe writing explicitely a line of code like:

chunk(DiscreteElement<Tag1>(0), DiscreteElement<Tag2>(1)) == chunk(DiscreteElement<Tag2>(1), DiscreteElement<Tag1>(0));

Would clarify the thing. I think this is quite evocative for a new user to understand the benefit of DDC, and constitutes a core concept.

(There are other ways to construct a DiscreteDomain but maybe it is not necessary to mention it)

blegouix avatar Jul 11 '24 09:07 blegouix

Please rebase on main

tpadioleau avatar Aug 02 '24 13:08 tpadioleau

I can continue to work on this after my return.

tpadioleau avatar Aug 02 '24 13:08 tpadioleau