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: Jeff Squyres (jsquyres_at_[hidden])
Date: 2010-07-28 07:56:19

On Jul 27, 2010, at 4:19 PM, Gus Correa wrote:

> Is there a simple way to check the number of bytes associated to each
> MPI basic type of OpenMPI on a specific machine (or machine+compiler)?
> Something that would come out easily, say, from ompi_info?

Not via ompi_info, but the MPI function MPI_GET_EXTENT will tell you the datatype's size.

[4:54] svbu-mpi:~/mpi % cat extent.f90
      program main
      use mpi
      implicit none
      integer ierr, ext
      call MPI_INIT(ierr)
      print *, 'Type extent of DOUBLE_PREC is', ext
      call MPI_FINALIZE(ierr)
[4:54] svbu-mpi:~/mpi % mpif90 extent.f90 -o extent -g
[4:54] svbu-mpi:~/mpi % ./extent
 Type extent of DOUBLE_PREC is 8
[4:54] svbu-mpi:~/mpi %

Jeff Squyres
For corporate legal information go to: