Skip to content

Don't use MPI_THREAD_SINGLE in a case statement #121

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

Open
eschnett opened this issue Oct 13, 2022 · 0 comments · May be fixed by #122
Open

Don't use MPI_THREAD_SINGLE in a case statement #121

eschnett opened this issue Oct 13, 2022 · 0 comments · May be fixed by #122

Comments

@eschnett
Copy link

Several examples in the EXAMPLE subdirectories use MPI constants such as MPI_THREAD_SINGLE in C case statements. This leads to compiler errors with certain MPI implementations.

I have written a forwarding MPI implementation MPItrampoline. In this implementation, MPI constants such as MPI_THREAD_SINGLE are regular integer constants and are not known at compile time. Consequently, they cannot be used in a C case statement. (The MPI standard 4.0 lists in section 2.5.4 which MPI constants can be used in case statements.)

Could you change you code to use if statements instead of a switch statement? I will open a pull request for this.

@eschnett eschnett linked a pull request Oct 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant