Commit 6ce38c27 authored by Kenneth Raffenetti's avatar Kenneth Raffenetti
Browse files

Fortran profiling interface fix



Previous re-organization of the library symbols resulted in a
situation where Fortran programs could no longer be profiled using
tools written in C. Functions in libmpifort directly called the
PMPI_* versions in libmpi.

Now we always call the MPI_* versions from libmpifort. In the case
where we are building a separate profiling library, we use a new
preprocessor flag to ensure we call PMPI_* from inside libpmpi.

Additional bug fix:
  - always define mpi_conversion_fn_null_, there is no pmpi version

Fixes #2209
Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
parent 64f60754
......@@ -150,6 +150,7 @@ if BUILD_PROFILING_LIB
lib_LTLIBRARIES += lib/lib@PMPILIBNAME@.la
lib_lib@PMPILIBNAME@_la_SOURCES = $(mpi_sources) $(mpi_f77_sources) $(mpi_core_sources)
lib_lib@PMPILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
lib_lib@PMPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DF77_USE_PMPI
lib_lib@PMPILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs)
EXTRA_lib_lib@PMPILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs)
......
......@@ -1370,11 +1370,13 @@ sub print_name_map_block {
#define ${lcprefix}${lcname}_ p${lcprefix}${lcname}_
#endif /* Test on name mapping */
#ifdef F77_USE_PMPI
/* This defines the routine that we call, which must be the PMPI version
since we're renaming the Fortran entry as the pmpi version. The MPI name
must be undefined first to prevent any conflicts with previous renamings. */
#undef ${ucprefix}${routine_name}
#define ${ucprefix}${routine_name} P${ucprefix}${routine_name}
#endif
#else
";
......@@ -5379,12 +5381,10 @@ extern FORT_DLL_SPEC int FORT_CALL mpi_conversion_fn_null_ ( void*v1, MPI_Fint*v
#endif
#ifndef MPICH_MPI_FROM_PMPI
/* This isn't a callable function */
FORT_DLL_SPEC int FORT_CALL mpi_conversion_fn_null_ ( void*v1, MPI_Fint*v2, MPI_Fint*v3, void*v4, MPI_Offset*v5, MPI_Fint *v6, MPI_Fint*v7, MPI_Fint *ierr ) {
return 0;
}
#endif
";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment