Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] MPI_Allreduce on local machine
From: Martin Siegert (siegert_at_[hidden])
Date: 2010-07-28 16:05:52

On Wed, Jul 28, 2010 at 11:19:43AM -0400, Gus Correa wrote:
> Hugo Gagnon wrote:
>> Hi Gus,
>> Ompi_info --all lists its info regarding fortran right after C. In my
>> case:
>> Fort real size: 4
>> Fort real4 size: 4
>> Fort real8 size: 8
>> Fort real16 size: 16
>> Fort dbl prec size: 4
>> Does it make any sense to you?
> Hi Hugo
> No, dbl prec size 4 sounds weird, should be 8, I suppose,
> same as real8, right?
> It doesn't make sense, but that's what I have (now that you told me
> that "dbl" , not "double", is the string to search for):
> $ Fort dbl prec size: 4
> Fort dbl cplx size: 4
> Fort dbl prec align: 4
> Fort dbl cplx align: 4
> Is this a bug in OpenMPI perhaps?
> I didn't come across to this problem, most likely because
> the codes here don't use "double precision" but real*8 or similar.
> Also make sure you are picking the right ompi_info, mpif90/f77, mpiexec.
> Often times old versions and tangled PATH make things very confusing.

This is indeed worrisome as I confirm the findings on our clusters both
with ompi 1.3.3 and 1.4.1:

ompi_info --all | grep -i fort
          Fort real size: 4
         Fort real4 size: 4
         Fort real8 size: 8
        Fort real16 size: -1
      Fort dbl prec size: 4
          Fort cplx size: 4
      Fort dbl cplx size: 4
         Fort cplx8 size: 8
        Fort cplx16 size: 16
        Fort cplx32 size: -1
      Fort integer align: 4
     Fort integer1 align: 1
     Fort integer2 align: 2
     Fort integer4 align: 4
     Fort integer8 align: 8
    Fort integer16 align: -1
         Fort real align: 4
        Fort real4 align: 4
        Fort real8 align: 8
       Fort real16 align: -1
     Fort dbl prec align: 4
         Fort cplx align: 4
     Fort dbl cplx align: 4
        Fort cplx8 align: 4
       Fort cplx16 align: 8

And this is the configure output:
checking if Fortran 77 compiler supports REAL*8... yes
checking size of Fortran 77 REAL*8... 8
checking for C type corresponding to REAL*8... double
checking alignment of Fortran REAL*8... 1
checking if Fortran 77 compiler supports DOUBLE PRECISION... yes
checking size of Fortran 77 DOUBLE PRECISION... 8
checking for C type corresponding to DOUBLE PRECISION... double
checking alignment of Fortran DOUBLE PRECISION... 1

But the following code actually appears to give the correct results:

program types
use mpi
implicit none
integer :: mpierr, size

   call MPI_Init(mpierr)
   call MPI_Type_size(MPI_DOUBLE_PRECISION, size, mpierr)
   print*, 'double precision size: ', size
   call MPI_Finalize(mpierr)

mpif90 -g types.f90
mpiexec -n 1 ./a.out
 double precision size: 8

Thus is this a bug in ompi_info only?


Martin Siegert
Head, Research Computing
WestGrid/ComputeCanada Site Lead
IT Services                                phone: 778 782-4691
Simon Fraser University                    fax:   778 782-4242
Burnaby, British Columbia                  email: siegert_at_[hidden]
Canada  V5A 1S6