Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] MPI_SUM and MPI_REAL16 with MPI_ALLREDUCE in fortran90
From: Julien Devriendt (jeg_at_[hidden])
Date: 2008-10-23 07:37:51


Hi,

I'm trying to do an MPI_ALLREDUCE with quadruple precision real and
MPI_SUM and open mpi does not give me the correct answer (vartemp
is equal to vartored instead of 2*vartored). Switching to double precision
real works fine.
My version of openmpi is 1.2.7 and it has been compiled with ifort v10.1
and icc/icpc at installation

Here's the simple f90 code which fails:

program test_quad

   implicit none

   include "mpif.h"

   real(kind=16) :: vartored(8),vartemp(8)
   integer :: nn,nslaves,my_index
   integer :: mpierror

   call MPI_INIT(mpierror)
   call MPI_COMM_SIZE(MPI_COMM_WORLD,nslaves,mpierror)
   call MPI_COMM_RANK(MPI_COMM_WORLD,my_index,mpierror)

   nn = 8
   vartored = 1.0_16
   vartemp = 0.0_16
   print*,"P1 ",my_index,vartored
   call MPI_ALLREDUCE(vartored,vartemp,nn,MPI_REAL16,MPI_SUM,MPI_COMM_WORLD,mpierror)
   print*,"P2 ",my_index,vartemp

   stop

end program test_quad

Any idea why this happens?

Many thanks in advance!

J.