[MPICH] Difference in sizes reported by MPI_DOUBLE & double

William Gropp gropp at mcs.anl.gov
Thu Jul 5 13:05:56 CDT 2007


MPI_DOUBLE is not a C type name; it is the handle of the MPI object  
that describes a double.  You should use MPI_Type_size( MPI_DOUBLE,  
&size ) to find the size of the data item associated with an MPI type  
like MPI_DOUBLE.

Bill

On Jul 5, 2007, at 1:02 PM, Christina Patrick wrote:

> Hi Everybody,
>
> I have written an MPI program on "Linux 2.6.17-1.2142_FC4smp #1 SMP",
> architecture is i686 to print the size of MPI_DOUBLE and double (C
> primitive datatype). Both of them report different sizes. I am a bit
> curious about this and would appreciate if any of anybody could shed
> some light on this. My program writes some data to a file and then
> reads it back. Because of the discrepancy in sizes, I am getting some
> problems.
>
> sizeof(double) = 8
> sizeof(MPI_DOUBLE) = 4
>
> Thanks and Warm Regards,
> Christina.
>




More information about the mpich-discuss mailing list