Skip to content

F08: refactor templates #13202

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

Merged
merged 1 commit into from
May 1, 2025
Merged

Conversation

hppritcha
Copy link
Member

This PR refactors some of the f08 template files introduced in PR #12621. Many of them had been using, incorrectly, macros from fint_2_int.h. The code in the use-mpi-f08 folder now makes use of generated code in the wrapper around the internal c code to avoid many of the problems that these older macros were trying to solve by providing 'c' interfaces directly to the fortran compiler. Also, generalized macros for handling translation of arrays of MPI_Fint's to c int's (and other types) are used in these templates.

Related to #13168 and associated issue raised by a user on the mail list.

@hppritcha hppritcha marked this pull request as draft April 21, 2025 14:34
@hppritcha hppritcha force-pushed the refactor_f08_templates branch from 9276561 to 717d5f9 Compare April 29, 2025 22:02
@hppritcha hppritcha marked this pull request as ready for review April 29, 2025 23:04
@hppritcha hppritcha requested a review from devreal April 29, 2025 23:05
@hppritcha
Copy link
Member Author

@devreal when you get a chance.

Copy link
Contributor

@devreal devreal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one nit-pick.

@hppritcha hppritcha force-pushed the refactor_f08_templates branch from 717d5f9 to a80f1a4 Compare April 30, 2025 15:42
@hppritcha hppritcha requested a review from devreal April 30, 2025 15:42
@@ -26,6 +26,7 @@
#include "ompi/datatype/ompi_datatype.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "bigcount.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work on out-of-tree builds or should that be?

Suggested change
#include "bigcount.h"
#include "ompi/mpi/fortran/use-mpi-f08/base/bigcount.h"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. patched that one too.

This PR refactors some of the f08 template files introduced in PR open-mpi#12621.
Many of them had been using, incorrectly, macros from fint_2_int.h.
The code in the use-mpi-f08 folder now makes use of generated code
in the wrapper around the internal c code to avoid many of the problems
that these older macros were trying to solve by providing 'c' interfaces
directly to the fortran compiler.  Also, generalized macros for handling
translation of arrays of MPI_Fint's to c int's (and other types) are used in these
templates.

Related to open-mpi#13168 and associated issue raised by a user on the mail list.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
@hppritcha hppritcha force-pushed the refactor_f08_templates branch from a80f1a4 to 493a6f8 Compare April 30, 2025 21:42
@hppritcha hppritcha requested a review from devreal April 30, 2025 21:42
Copy link
Contributor

@devreal devreal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@hppritcha hppritcha merged commit f5b0876 into open-mpi:main May 1, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants