kamping-site / kamping

KaMPIng: (Near) zero-overhead MPI wrapper for modern C++
https://kamping-site.github.io/kamping/
GNU Lesser General Public License v3.0
36 stars 0 forks source link

C++20 Wishlist #195

Open kurpicz opened 2 years ago

kurpicz commented 2 years ago

Why a C++20 Whishlist?

Currently, KaMPI.ng is limited by the compilers widely available at HPC clusters. Since we want to target all major compilers usually used at these clusters, we have to wait for the Intel compiler to support most of the C++20 features, before we start using them. However, during development, we oftentimes think that using a specific C++20 feature would reduce development time or simply make the code more expressive.

This issue should be extended whenever we stumble over such a feature. I think it is the best to simply edit this issue and use the comments for discussion.

The List

Concepts

We should use concepts wherever possible, e.g., for different buffer types. This allows us to better specify different template parameters and would make the code way more expressive. The same holds for the parameters passed to the wrapped MPI functions. Here, template<Parameters... parameters> looks better than template<typename... Args>.

Constexpr Algorithms

With C++20, we get access to a lot constexpr algorithms and data structures, e.g., std::vector. We should use them to make our named parameter stuff (selection and checking) more expressive and easier to extend and/or debug.

DanielSeemaier commented 2 years ago

With C++20, we could also discuss replacing our current interface with designated initializers (this would obviously be an API-breaking change).

Pros:

Hespian commented 2 years ago

With C++20, we could also discuss replacing our current interface with designated initializers (this would obviously be an API-breaking change).

Can we leave out parameters with that?

DanielSeemaier commented 2 years ago

Yeah

niklas-uhl commented 1 year ago

Concepts also allow us to get rid of the compilation failure tests. See the last part of this article.

lukashuebner commented 1 year ago

508