Represent data on regularly spaced N-dimensional grids.
The accelerated histogram method (awh), PME summation, fourier-transform and experimental input from crystallography and cryo-EM make extensive use of data on regular grids.
A common data structure should simplify accessing grid points in space and iterating over lattices and parts of them.
Further related to em-core development, a library for cryo-EM refinement, see here [[https://drive.google.com/drive/folders/0BwBKE-uRQnTzQ1AxY0pTWURPelU]]
mdspan - basic infrastructure
Setting up directory to contain a stripped-down and modified-for-GROMACS
version of a reference implementation of the LEWG P0009 proposal,
"mdspan: A Non-Owning Multidimensional Array Reference"
Original code is available at
Refers to #2281
mdspan - extents of multidimensional arrays.
Extents describe the number of elements along a certain dimension, a
multidimensional index space of rank R. This is equivalent to the
Cartesian product space of integer intervals [0, N_0) x [0, N_1) x ... x
The extents class distinguishes between extents known at compile time
(static) or at run time (dynamic). Static extents are templated to allow
compile time indexing evaluation (part of later patch).
Confer to P0009r8 of the Library Evolution Working Group and
Source code copied and modified from Oakridge National Labs repository.
#10 Updated by Christian Blau almost 3 years ago
For proposals for the C++ standard where the grid is a non-owning special case of an arrayRef (mdspan) see here:
- Multidimensional Array Reference * A Minimal mdspan<> * Multidimensional bounds, offset and array_view * Additions to Array View for Performance * Span: bounds-safe views for sequences of objects * Multidimensional bounds, index and array_view
#13 Updated by Christian Blau almost 2 years ago
I figure there are two different questions to address:
1. How do represent multidimensional arrays, optimally with arbitrary strides, padding and without performance overhead?
2. How do we translate multidimensional coordinates to lattice-point?
For 1. I concluded in https://gerrit.gromacs.org/#/c/7081/:
"Then I would put P0009  from github.com/ORNL/cpp-proposals-pub/ in utilities once we bump to C++14."
Build our own, trying to use as much of P0009 infrastructure as possible. Add the iterator back into P0009.
My code built onto N3851, but I planned to rebase onto P0009 once we're through with the beta release.
My hope would be that P0009 would make the Thomas 2d irreg array patch a bit smaller as well; looking at the very good tests there at least.
I would like to gather the relevant use cases that already exist in GROMACS, and start to use new concepts there as much as possible rather than implementing for use in future modules.
#15 Updated by Christian Blau almost 2 years ago
Find related data structures in other tools here:
The mdspan in P0009 mirrors most of the aspects of matrices in the Eigen library and allows to extract the information needed to build CPyArrayObjects without copying data, so I would argue that this strengthens the case for mdspan even more.