[mpich-discuss] f77 bindings and profiling

Isaila, Florin D. fisaila at mcs.anl.gov
Mon Nov 17 15:28:43 CST 2014

Hi ,

I am trying to use MPI profiling to make mpi_init from a F77 program call my MPI_Init (written in C), but I do not manage to achieve that. In this simple F77 program:
       program main
       include  'mpif.h'
       integer error
       call mpi_init(error)
       call mpi_finalize(error)

I try to make the mpi_init  call:
int MPI_Init (int *argc, char ***argv){  int ret;
  printf("My function!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
  ret = PMPI_Init(argc, argv);
  return ret;

My MPI_Init belongs to a library libtarget.a I created. I use -profile for compiling and I created the target.conf containing:
PROFILE_PRELIB="-L/homes/fisaila/benches/try/staticlib_mpif77 -ltarget"
in the right place.

The library appears in the command line  before the mpich library:
mpif77 -show -g -profile=target init_finalize.f -o init_finalize
gfortran -g init_finalize.f -o init_finalize -I/homes/fisaila/software/mpich/include -L/homes/fisaila/software/mpich/lib -L/homes/fisaila/benches/try/staticlib_mpif77 -ltarget -Wl,-rpath -Wl,/homes/fisaila/software/mpich/lib -lmpich -lopa -lmpl -lrt -lpthread

However, the program never gets into my MPI_Init.

Any suggestion about what I am missing?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20141117/7ce29eb7/attachment.html>

More information about the discuss mailing list