solvcon / modmesh

Toolkit for solving partial differential equations
BSD 3-Clause "New" or "Revised" License
29 stars 35 forks source link

Develop resizable container for `Edge3d` and `Bezier3d` #322

Open yungyuc opened 2 months ago

yungyuc commented 2 months ago

In World class template Edge3d and Bezier3d are kept in std::deque. The use of STL container does not offer flexible resource management. We should develop dedicated containers for Edge3d and Bezier3d. SimpleCollector may be considered as a building block.

Tucchhaa commented 2 weeks ago

We need to create dedicated containers, so that we can line up memory correctly. We need this so we can use GPU (CUDA) for computations. Correct me if I'm wrong)

So, here's the question: How can I figure out how data should be lined up? Or is it doesn't matter at this point, and we should just develop the functionality for lining up those data?

yungyuc commented 1 week ago

Aligning memory is just one item in the scope of resource management. While STL provides the allocator for customizing memory management, it is not a comprehensive interface for managing all resources. A dedicated container type removes the concerns. The development of a resource-savvy container will not follow a sequentially itemized course. Instead, it will be an evolutionary process consisting of improvement requests from applications.

Answer to your question in short: It does not matter how data should be aligned at the moment. It has been shown that we do not need to worry about alignment now: https://github.com/solvcon/modmesh/issues/307#issuecomment-2149376670 . It will be an issue, like when we want to use GPU. But I think the time of using metal for GPU will come sooner than that of using CUDA.

Edge3d and Bezier3d are part of a (not-yet-materialized) prototype of mesh generator (mesher) for the multi-dimensional CESE solver. Making the mesher is not of a high priority because most users already have the meshes done.