---
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
Portugal
tel: +351 21 8419202
fax: +351 21 8464455
Message: 4
Date: Mon, 27 Jul 2009 17:13:23 -0400
From: George Bosilca <bosilca@eecs.utk.edu>
Subject: Re: [OMPI users] MPI_IN_PLACE in Fortran with MPI_REDUCE /
MPI_ALLREDUCE
To: Open MPI Users <users@open-mpi.org>
Message-ID: <966A51C3-A15F-425B-A6B0-81221033CCF1@eecs.utk.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Ricardo,
I can't reproduce your problem with the latest version (trunk r21734).
If I run the provided program on two nodes I get the following answer.
[***]$ mpif77 inplace.f -o inplace -g
[***]$ mpirun -bynode -np 2 ./inplace
Result:
3.0000000 3.0000000 3.0000000 3.0000000
This seems correct and in sync with the C answer.
george.
On Jul 27, 2009, at 09:42 , Ricardo Fonseca wrote:program inplaceuse mpiimplicit noneinteger :: ierr, rank, rsize, bsizereal, dimension( 2, 2 ) :: buffer, outinteger :: rccall MPI_INIT(ierr)call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)call MPI_COMM_SIZE(MPI_COMM_WORLD, rsize, ierr)buffer = rank + 1bsize = size(buffer,1) * size(buffer,2)if ( rank == 0 ) thencall mpi_reduce( MPI_IN_PLACE, buffer, bsize, MPI_REAL, MPI_SUM,0, MPI_COMM_WORLD, ierr )elsecall mpi_reduce( buffer, 0, bsize, MPI_REAL, MPI_SUM,0, MPI_COMM_WORLD, ierr )endif! use allreduce instead! call mpi_allreduce( MPI_IN_PLACE, buffer, bsize, MPI_REAL,MPI_SUM, MPI_COMM_WORLD, ierr )if ( rank == 0 ) thenprint *, 'Result:'print *, bufferendifrc = 0call mpi_finalize( rc )end program