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

Fix error in configuration test for MPI_IN_PLACE. #540

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

mmuetzel
Copy link
Contributor

Almost all MPI functions in Fortran need an additional argument for returning an error code. Add that argument when calling MPI_AllReduce in the test program.

@mmuetzel mmuetzel marked this pull request as draft August 27, 2024 21:11
@mmuetzel
Copy link
Contributor Author

Hmmm... For some reason the test now passes on MinGW (where it was designed to fail).
Somethings not quite right...

I'll try to look into that in the coming days...

@mmuetzel
Copy link
Contributor Author

It turns out mpif90 isn't actually used to build the test file. Instead, compilation fails and no error code is set because the binary was never executed.
That might have been an issue since that test was added. (That's my bad. Sorry for that.)

Almost all MPI functions in Fortran need an additional argument for
returning an error code. Add that argument when calling
`MPI_AllReduce` in the test program.
Overriding `CMAKE_Fortran_COMPILER` doesn't have an effect for `try_run`.
Instead, link to the imported target `MPI::MPI_Fortran` which should
contain all settings that are needed to build a Fortran file using MPI
functions.
Also, check if compilation of the test program failed.
@mmuetzel
Copy link
Contributor Author

I pushed another commit that links to the imported target MPI::MPI_Fortran. At least on Windows, that made the program build for me again.

@mk3z: Could you please check if that works correctly on Nix now? You reported issues with the changes in #523. (I erroneously assumed that those issues were fixed by setting CMAKE_Fortran_COMPILER. But it turns out that doesn't have any effect - and compilation of that test just failed.)

@mmuetzel mmuetzel marked this pull request as ready for review August 28, 2024 12:09
@mk3z
Copy link
Member

mk3z commented Aug 28, 2024

Seems to work on Nix

@raback raback merged commit 7b74eda into ElmerCSC:devel Aug 28, 2024
11 checks passed
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 this pull request may close these issues.

3 participants