Hi George

I did some extra digging and found that (for some reason) the MPI_IN_PLACE parameter is not being recognized as such by mpi_reduce_f (reduce_f.c:61). I added a couple of printfs:

    printf(" sendbuf = %p \n", sendbuf );

    printf(" MPI_FORTRAN_IN_PLACE = %p \n", &MPI_FORTRAN_IN_PLACE );
    printf(" mpi_fortran_in_place = %p \n", &mpi_fortran_in_place );
    printf(" mpi_fortran_in_place_ = %p \n", &mpi_fortran_in_place_ );
    printf(" mpi_fortran_in_place__ = %p \n", &mpi_fortran_in_place__ );

And this is what I get on node 0:

 sendbuf = 0x50920 
 mpi_fortran_in_place = 0x17cd34 
 mpi_fortran_in_place_ = 0x17cd38 
 mpi_fortran_in_place__ = 0x17cd3c 

This makes OMPI_F2C_IN_PLACE(sendbuf) fail. If I replace the line:

sendbuf = OMPI_F2C_IN_PLACE(sendbuf);


    if ( sendbuf == 0x50920 ) {
      printf("sendbuf is MPI_IN_PLACE!\n");
      sendbuf = MPI_IN_PLACE;

Then the code works and gives the correct result:

sendbuf is MPI_IN_PLACE!
 3. 3. 3. 3.

So my guess is that somehow the MPI_IN_PLACE constant for fortran is getting the wrong address. Could this be related to the fortran compilers I'm using (ifort / g95)?



Prof. Ricardo Fonseca

GoLP - Grupo de Lasers e Plasmas

Instituto de Plasmas e Fusão Nuclear

Instituto Superior Técnico

Av. Rovisco Pais

1049-001 Lisboa


tel: +351 21 8419202

fax: +351 21 8464455

web: http://cfp.ist.utl.pt/golp/ 

On Jul 28, 2009, at 17:00 , users-request@open-mpi.org wrote:

Message: 1
Date: Tue, 28 Jul 2009 11:16:34 -0400
From: George Bosilca <bosilca@eecs.utk.edu>
Subject: Re: [OMPI users] OMPI users] MPI_IN_PLACE in Fortran with
To: Open MPI Users <users@open-mpi.org>
Message-ID: <C0F59401-0A63-4EB8-804B-51D29071295E@eecs.utk.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes