Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++20 Wishlist #195

Open
kurpicz opened this issue Mar 24, 2022 · 5 comments
Open

C++20 Wishlist #195

kurpicz opened this issue Mar 24, 2022 · 5 comments

Comments

@kurpicz
Copy link
Member

kurpicz commented Mar 24, 2022

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
Copy link
Member

DanielSeemaier commented Mar 24, 2022

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

@Hespian
Copy link
Member

Hespian commented Mar 25, 2022

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
Copy link
Member

Yeah

@niklas-uhl
Copy link
Member

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

@lukashuebner
Copy link
Member

#508

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants