[Mpi-forum] MPI_Type_size question
Rob Ross
rross at mcs.anl.gov
Fri Jun 18 15:13:26 CDT 2010
Hi,
Your type isn't big enough to cause overflow. But yes it's an issue.
Rob
On Jun 18, 2010, at 11:55 AM, Fab Tillier wrote:
> Hi Folks,
>
> Looking at putting together the MPI_Count ticket, I ran across the
> following issue and was hoping to get some guidance. Take the
> following code, using the current int counts, and assume sizeof(int)
> == 4, sizeof(MPI_DOUBLE) == 8:
>
> {
> MPI_Datatype myType;
> MPI_Type_contiguous( 1048576, MPI_DOUBLE, &myType );
>
> int size;
> MPI_Type_size( myType, &size );
> }
>
> Should MPI_Type_size return an error, due to overflow? Does size
> get set to MPI_UNDEFINED and the call succeeds?
>
> Similar issues exist for MPI_Pack with the outsize and position
> parameters, MPI_Unpack with the insize and position parameters, and
> MPI_Pack_size with the size parameter.
>
> Lastly, it is my belief that these parameters should really be of
> type MPI_Aint, but changing this would break backward
> compatibility. They cannot be of type MPI_Count, since overflow can
> occur if MPI_Count is defined as a C int. How should the standard
> handle this?
>
> Thoughts?
> -Fab
>
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum
More information about the mpi-forum
mailing list