Git Product home page Git Product logo

ddc's Issues

Prepare v1 release

  • namespace ddc
  • document the concepts
  • architectures support: NVIDIA and AMD GPUs, CPUs
  • respect naming conventions

Clearly distinguish `DiscreteCoordinate`/`DiscreteVector`

Issue following issue 41 in the gitlab.

I think we need three types similar to the manipulation of pointers in C++:

  • T*
  • std::size_t
  • std::ptrdiff_t

In our case we would have:

  • DiscreteCoordinate, identifier of a element of discretization
  • DiscreteSize, multidimensional size
  • DiscreteVector, multidimensional displacement

Discussion about Intel GPU support

We currently use global variables to store some data related to discrete spaces. I do not see any implementation of a device global variable for now, only a discussion about it here, see also there.

Cleanup inline, constexpr & noexcept

We currently apply the constexpr, inline & noexcept modifiers to functions somewhat randomly. This should be reviewed. We should come up with some guidelines and apply them all-around.

Distinguish between vertices, edges, faces & cells in the discretization

See https://gitlab.maisondelasimulation.fr/gysela-developpers/voicexx/-/issues/34

Currently and according to Voice++#26 , we only discretize points (vertices).
I would like to introduce edges discretization also.

For example, in 3D, this could look like so:

using IDimX = ×DiscretizationOf<RDimX>;
using IDimY = ×DiscretizationOf<RDimY>;
using IDimZ = ×DiscretizationOf<RDimZ>;

using IVerticesSpace = DiscreteSpace<IDimX,        IDimY,        IDimZ>;
using IXEdgesSpace   = DiscreteSpace<IDimX::Edges, IDimY,        IDimZ>;
using IYEdgesSpace   = DiscreteSpace<IDimX,        IDimY::Edges, IDimZ>;
using IXFacesSpace   = DiscreteSpace<IDimX,        IDimY::Edges, IDimZ::Edges>;
using IYFacesSpace   = DiscreteSpace<IDimX::Edges, IDimY,        IDimZ::Edges>;
using ICellsSpace    = DiscreteSpace<IDimX::Edges, IDimY::Edges, IDimZ::Edges>;

The real type would be a tensor product that would combine either Point<RDim> or Interval<RDim>

using RVertex = VectorElement<Point<RDimX>,    Point<RDimY>,    Point<RDimZ>>;
using RXEdge  = VectorElement<Interval<RDimX>, Point<RDimY>,    Point<RDimZ>>;
using RYEdge  = VectorElement<Point<RDimX>,    Interval<RDimY>, Point<RDimZ>>;
using RXFace  = VectorElement<Point<RDimX>,    Interval<RDimY>, Interval<RDimZ>>;
using RYFace  = VectorElement<Interval<RDimX>, Point<RDimY>,    Interval<RDimZ>>;
using RCell   = VectorElement<Interval<RDimX>, Interval<RDimY>, Interval<RDimZ>>;

The to_real() function would yield a type that depends on the discrete space:

IVerticesSpace vertices_space = /*[...]*/;
ICellsSpace cell_space = /*[...]*/;
RVertex = vertices_space.to_real(/*[...]*/);
RCell = cell_space.to_real(/*[...]*/);

Can't create a multi-D `Coordinate` from a multi-D `DiscreteElement`

I can do:

Coordinate<MyDim> get_coord(DiscreteElement<UniformPointSampling<MyDim>> el) {
    return coordinate(el);
}

but not:

Coordinate<MyDim1, MyDim2> get_coord(DiscreteElement<UniformPointSampling<MyDim1>,UniformPointSampling<MyDim2>> el) {
    return coordinate(el);
}

This should be possible

Use a signed integer type for DiscreteElementType

With the recent possibility for mdspan to choose the index_type, I think we should a signed integer type common for DiscreteElementType, std::extents and iterators difference_type that is to say std::ptrdiff_t.

Optimize FFT normalization

Depending on the choice of normalization, the norm_coef can be 1. In these cases we could optimize out the loop normalizing the data.

Public header naming convention

Should we have different public headers for the library, with a naming convention, or only a single header like #include <ddc>

Looping over an empty domain results in entering into the loop

In the following code:

DiscreteDomain<BSplines> const dom_bsplines_singular(
            DiscreteElement<BSplines>(0),
            DiscreteVector<BSplines>(BSplines::n_singular_basis()));
Chunk<double, DiscreteDomain<BSplines>> singular_spline_coef(dom_bsplines_singular);
for_each(singular_spline_coef.domain(), [&](DiscreteElement<BSplines> const i) {
    singular_spline_coef(i) = 1.0;
});

where n_singular_basis() returns 0, the loop is entered resulting in a seg fault at the line singular_spline_coef(i) = 1.0;

Allow addition of non-exact matching objects

I think it would be useful to allow expressions such as:

ddc::DiscreteElement<Dim1, Dim2> old_pos = ...;
ddc::DiscreteElement<Dim1, Dim2> new_pos = old_pos + ddc::DiscreteVector<Dim2>(3);

Currently it is only possible to do:

ddc::DiscreteElement<Dim1, Dim2> old_pos = ...;
ddc::DiscreteElement<Dim1, Dim2> new_pos = old_pos + ddc::DiscreteVector<Dim1, Dim2>(3, 0);

This addition would be useful in cases where we know that Dim2 is one of the dimensions but we don't want to specialise the function for all possible values of Dim1 (present or not present)

Rename internal types to match new naming scheme

Our types in classes haven't been renamed in the big !73 renaming. For example, we have stuff like:

template <class... DDims>
class DiscreteDomain
{
public:
    using mcoord_type = DiscreteCoordinate<DDims...>;
};

This should read more like:

template <class... DDims>
class DiscreteDomain
{
public:
    using discrete_coordinate_type = DiscreteCoordinate<DDims...>;
};

Unification of the interface of multi-dimensional algorithms

I suggest that we try an implementation of the for_each algorithm independent of the DiscreteDomain and DiscreteVector classes. I would prefer an implementation that should work for any class that implements the concept of a cartesian product, that remains to be defined.

This also applies to transform_reduce and deep_copy.

parallel loops with scratch buffer

We should offer a way to provide a scratch buffer in our parallel loops that would support efficient access when all iterations access the buffer with the same pattern (one buffer/thread on the right NUMA node for OMP, interleaved buffers on GPU, etc.)
I believe this can be built on top of #56 & #57 .

Introduce a namespace

I suggest to introduce a ddc namespace along with using namespace ddc; in the <ddc/ddc.hpp> header to not break application codes for now.

Decouple discrete dimensions from discrete spaces

As for now, discrete dimensions are represented by the discrete spaces themselves. For example this forces the definition of two classes to differentiate nodes from cells in a 1d mesh.
We want to decouple the two in order to be able to ease the definition of multiple discrete dimensions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.