Skip to content

MPI_IN_PLACE problem in openmpi-1.8.3 (FORTRAN) #259

@yafshar

Description

@yafshar

There seems to be a bug at using MPI_IN_PLACE at this release, using it will return zero value.

 program main
   use mpi
   implicit none
   integer :: ierr, rank
   real(8) :: a
   call MPI_INIT(ierr)
   call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
   select case (rank)
   case (0)
      a=10._8
   case (1)
      a=-300._8
   case(2)
      a=-150._8
    end select
    print*,rank,a
    call MPI_Allreduce(MPI_IN_PLACE,a,1,MPI_DOUBLE_PRECISION,MPI_MIN,MPI_COMM_WORLD,ierr)
    print*,rank,"---",a
    call MPI_Finalize(ierr)
end program 

and compiling the program with mpif90 and running it will result

mpirun -np 3 ./a.out 
           0   10.000000000000000     
           1  -300.00000000000000     
           2  -150.00000000000000     
           0 ---   0.0000000000000000     
           1 ---   0.0000000000000000     
           2 ---   0.0000000000000000

Not using MPI_IN_PLACE will give the correct result.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions