open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.15k stars 859 forks source link

Fortran wrappers are calling f2c/c2f MPI functions which get intercepted by PMPI routines #27

Open ompiteam opened 10 years ago

ompiteam commented 10 years ago

The current Fortran wrappers make calls to several f2c/c2f MPI functions. This causes any PMPI interposed library to intercept these calls erroneously (ie think that the user has called these routines). Though the MPI spec http://www.mpi-forum.org/docs/mpi-11-html/node162.html#Node163 does not disallow this it seems this goes against the general OMPI rules of never calling an MPI function from inside the library. It also is a regression from what Sun did originally.

I've talked with Jeff about this issue and the below is what would need to be done to fix this issue:

We can't assume that the PMPI functions are there because there is a --disable-mpi-profile configure switch that will turn off the PMPI layer (it's there for platforms that don't have weak symbols, like OS X -- so the PMPI layer means compiling the entire MPI layer a 2nd time, which takes a lot of time; disabling it means a much faster build [for developers]).

So you just need to convert these functions to ompi() functions (vs. PMPI() functions) and then call those instead. Then also convert the various C MPI_F2C/C2F() functions to call these ompi() functions as well -- so everything uniformly calls these functions: the MPI_*_C2F/F2C functions and the Fortran functions.

ompiteam commented 10 years ago

Imported from trac issue 1184. Created by tdd on 2007-11-07T08:07:16, last modified: 2007-11-07T08:07:16