jeffhammond / vapaa

A standalone implementation of the MPI Fortran 2018 module
MIT License
19 stars 1 forks source link

implement MPI_F_STATUS_IGNORE #35

Open jeffhammond opened 4 months ago

jeffhammond commented 4 months ago

This is low priority, but MPI_Init needs to set the C pointers that store the address of the Fortran buffer sentinels for ignoring status so that tools can intercept the Fortran API with C code.

In theory, we need to interpose MPI_Init in the C library for scenarios when the user initializes MPI with C instead of Fortran.

Two global variables of type MPI_Fint*, MPI_F_STATUS_IGNORE and MPI_F_STATUSES_IGNORE are declared in mpi.h. They can be used to test, in C, whether f_status is the Fortran value of MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE defined in the mpi module or (deprecated) mpif.h. These are global variables, not C constant expressions and cannot be used in places where C requires constant expressions. Their value is defined only between the calls to MPI_INIT and MPI_FINALIZE and should not be changed by user code.
This C routine converts a C MPI_Status into a Fortran mpi_f08 TYPE(MPI_Status). Two global variables of type MPI_F08_status*, MPI_F08_STATUS_IGNORE and MPI_F08_STATUSES_IGNORE are declared in mpi.h. They can be used to test, in C, whether f_status is the Fortran value of MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE defined in the mpi_f08 module. These are global variables, not C constant expressions and cannot be used in places where C requires constant expressions. Their value is defined only between the calls to MPI_INIT and MPI_FINALIZE and should not be changed by user code.