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

binding/io: misc issues related to io binding generation #7276

Merged
merged 10 commits into from
Feb 3, 2025

Conversation

hzhou
Copy link
Contributor

@hzhou hzhou commented Jan 23, 2025

Pull Request Description

  • Now all f2c/c2f functions are actual C functions (rather than macros), the f08 binding can directly call those functions.
    This is one step toward MPI ABI since it no longer assume handles are
    integers. The next step is to adjust handle sizes (e.g. c_Comm) based on
    whether mpi ABI is enabled.

  • Now MPI-IO functions are always available -- dummy functions if ROMIO is
    disabled -- the fortran bindings no longer need the "-no-mpiio" option.

  • Remove HAVE_CXX_IO and HAVE_ROMIO check in the CXX binding.

  • Add back the ROMIO_VERSION macro in mpi.h (since some downstream relies on it)

  • Skip installing mpio.h if builds FROM_MPICH

Fixes #7278
Fixes #7277

  • TODO: add test to cover the romio split end routine using NULL buffer.

[skip warnings]

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou hzhou force-pushed the 2501_fortran_io branch 2 times, most recently from 316d1e7 to fd39c3f Compare January 24, 2025 22:30
@hzhou
Copy link
Contributor Author

hzhou commented Jan 24, 2025

test:mpich/ch3/tcp ✔️
test:mpich/ch4/ofi ✔️

test:mpich/custom --disable-romio
netmod: ch3:tcp

@hzhou hzhou changed the title binding/fortran: update python scripts now we always have IO functions binding/io: misc issues related to io binding generation Jan 24, 2025
@hzhou
Copy link
Contributor Author

hzhou commented Jan 27, 2025

test:mpich/custom --disable-romio
netmod: ch3:tcp
✔️

@hzhou
Copy link
Contributor Author

hzhou commented Jan 27, 2025

test:mpich/ch4/most

@hzhou hzhou requested a review from raffenet February 3, 2025 18:02
hzhou added 10 commits February 3, 2025 12:35
Now all f2c/c2f functions are actual C functions (rather than macros),
the f08 binding can directly call those functions.

This is one step toward MPI ABI since it no longer assume handles are
integers. The next step is to adjust handle sizes (e.g. c_Comm) based on
whether mpi ABI is enabled.

What about PMPI f2c interfaces such as PMPI_File_f2c? I am punting it
until someone asks for it.
Now MPI-IO functions are always available -- dummy functions if ROMIO is
disabled -- the fortran bindings no longer need the "-no-mpiio" option.
The autoconf macro HAVE_CXX_IO is used in mpicxx.h to exclude MPI IO
interfaces if ROMIO is disabled. Similarly, the macro HAVE_ROMIO is
used in initcxx.cxx to exclude IO when ROMIO is disabled.

Now our binding layer will generate dummy MPI IO routines when ROMIO
is disabled, we no longer need the exclusions in the CXX binding.
Downstream applications such as mpi4py need a way to check whether ROMIO
is enabled and relies on the ROMIO_VERSION macro. It is used to be
defined in `mpio.h`. Now we no longer use mpio.h, it needs to be in
mpi.h.
Now mpich will generate io function prototypes and mpio.h is no longer
needed.
Unlike the begin routines (e.g. MPI_File_write_all_begin), the end
routines (e.g. MPI_File_write_all_end) doesn't provide count or
datatype, so we have no way of knowing whether the `buf` parameter is
may be NULL or not. Thus, skip the NULL pointer check.
* Remove leftover `check_PYTHON` call. The PYTHON is already checked
with check_python3() earlier.

* In checking existence of mydef_boot, check its bin folder. The module
path (modules/mydef_boot) may exist even without submodule checkout.

* Add cast to suppress the "%lld" printf when the actual type may be
"long" instead of "long long".

* Add -w in Makefile_f77.mtest to suppress all warnings since gfortran
always gives warnings despite -fallow-argument-mismatch.
@FORTRAN_MPI_OFFSET@ is used in mpif.h.in to define
MPI_DISPLACEMENT_CURRENT. Set it in MPICH configure rather than get it
from ROMIO configure.
Now that MPI-IO is always available in the interface, we need check
mpichversion to see whether romio is disabled during build.

Only define HAVE_MPI_IO if romio is not disabled.
@hzhou hzhou merged commit 576ac08 into pmodels:main Feb 3, 2025
4 checks passed
@hzhou hzhou deleted the 2501_fortran_io branch February 3, 2025 20:16
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.

romio: mpi4py need ROMIO_VERSION macro mpich/master: MPI_File_write_all_end bug with nullptr since Jan 22
2 participants