binding/fortran: make libmpifort standalone#7803
Open
hzhou wants to merge 24 commits into
Open
Conversation
e116cee to
6e55129
Compare
Since MPL_hash is effectively a memory storage device, add a memory class to track it. Use bool instead of int or char value of 0 and 1. Fix MPL_hash_has, it need check whether the hash is empty.
We need set the last 8 bits of the internal type to the index of the original builtin type, or we will lose the original names.
920311e to
81858db
Compare
There are some build issue due to typerep_pre.h lives in src/mpi/datatype/typerep/src but it is used outside in mpir_misc.h. Consolidate the declarations into mpir_typerep.h. Move the declarations of MPIR_Localcopy family into mpir_typerep.h as well due to its dependency on struct MPIR_Typerep_req. They don't fit in mpir_misc.h anyway. Declare MPIDI_POSIX_rma_req_t in posix_types.h and use void * in posix_pre.h. This relieves the struggle of header dependency.
When configured with --disable-cxx, renaming MPICXXLIBNAME to MPILIBNAME results in duplicate target rules for lib@MPILIBNAME@.la.
Autoconf complains that we can't call AC_USE_SYSTEM_EXTENSIONS after PAC_CHECK_VISIBILITY.
Instead of build both mpich abi and mpi abi, only build a single library with --enable-mpi-abi. If configured with --enable-mpi-abi, we only install libmpi_abi.so and mpi.h will be a link to mpi_abi.h. Compiler scripts such as mpicc no longer supports -mpi-abi option. It will either link to libmpi.so or libmpi_abi.so based on the configure option.
Gather the code and remove leftovers from simplemake. Only define $ABIVERSIONFLAGS since now we only build one ABI.
Internally we will include mpi_mpich.h instead of mpi.h. On the other hand, mpi.h will be a copy from mpi_abi.h or mpi_mpich.h based on whether --enable-mpi-abi is configured. This allows examples as well as utilities (e.g. mpichversion and mpivars) to work when mpi-abi is enabled.
Since these links, including libmpl.so, libopa.so, libmpich.so, etc. are not in use any more, let's remove them.
Both are no longer in use. Just use subsystems to simplify the configure design.
This is only used in mpicxx.h. We don't need it now that we always define standard MPI Fortran datatypes in mpi.h.
Add MPIX_Init_fortran to initialize fortran datatypes. This is called from mpirinitc_ so Fortran applications will have the datatype initialized upon entry. TODO: add a mechanism for MPI_Init in libmpi.so to call MPIX_Init_fortran for those *C* programs that require Fortran interop such as MPI_Fint, xxx_f2c, etc. TODO: Call MPIX_Init_fortran for mpi_f08 module.
To separate the fortran binding from the core libmpi, we need rely on
MPI_Abi_set_fortran_info to support
MPI_Type_create_f90_{integer,real,complex}.
Always use MPI_{Comm,Type,...}_{from,to}int to convert handles between
Fortran and C rather than assuming the C handle types are int.
I don't think we are concerned with overhead of handle conversions. But
if we ever do care, we may add a configure option and internally define
the conversion functions into direct C casts.
Since now we only support the same Fortran compiler as FC and F77, we can directly use offset type as INTEGER(KIND=@OFFSET_KIND@).
We no longer support having romio define its own constants that are incompatible from MPICH or MPI ABI. Thus, we no longer need export ROMIO constants via mpiof.h. Remove all its support for mpiof.h.
With MPI 5.0, C programs should not need to use MPI_Fint directly. We hard code MPI_Fint as int in mpi.h, which is the common case, so legacy code should continue to work. If the Fortran compiler uses a different INTEGER size than C int, users can add `-DMPI_FINT_CTYPE=[ctype]` work around the issue. The proper solution is to avoid direct access of MPI_Fint altogether.
Move AC_ARG_WITH([wrapper-dl-type],...) into PAC_COMPILER_SHLIB_FLAGS since both need be set together.
Split the part of code from mpif_h/setbot.c that require autoconf substitutions so when we modify mpirinitc_ etc. we don't have to rerun autoconf. Split .gitignore as well since now the fortran binding is treated as separate.
The binding generation scripts can be run - 1. autogen from mpich main_top_srcdir. 2. src/binding/fortran/configure within the mpich source tree. 3. fortran binding tarball, i.e. src/binding/fortran without mpich source tree. This commit makes all 3 ways work. Option 2 and 3 of course depends on next commits. Set default option for "-mpi-h", which will be used for standalone libmpifort build. Remove the autogen check. In the coming commits, the python script will directly generate files without autoconf macros.
Configure and build the fortran binding separately from MPICH.
Configure and install mpifort and libmpifort.so from src/binding/fortran as a sub-package..
Let MPI_Init initialize Fortran datatypes and inter-op functions.
The mpi_f08 module also need call MPIX_Init_fortran to initialize the datatypes.
Contributor
Author
|
test:mpich/ch3/tcp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Configure and build the fortran binding separately from MPICH.
src/binding/fortran/will be separately packaged and be able to build stand-aloneIt will install
mpifortandlibmpifort.sompiccby default only links tolibmpi.so, which will not contain any Fortran, includingMPI_INTEGER,MPI_Comm_f2c, etc.mpicc -fortranwill attempt to link inlibmpifort.soso C programs that needs Fortran inter-op will workTODO
Remove the mpich handle assumption that uses direct cast for handle conversions
mpif_huse_mpi_f08Check
MPIX_dependency and create fallbacks[skip warnings]
Author Checklist
Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
Commits are self-contained and do not do two things at once.
Commit message is of the form:
module: short descriptionCommit message explains what's in the commit.
Whitespace checker. Warnings test. Additional tests via comments.
For non-Argonne authors, check contribution agreement.
If necessary, request an explicit comment from your companies PR approval manager.