Open kurpicz opened 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:
go from template magic to trivial C code
compiler / language server knows supported arguments
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?
Yeah
Concepts also allow us to get rid of the compilation failure tests. See the last part of this article.
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 thantemplate<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.