Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] RFC: add support for large counts using derived datatypes
From: Nathan Hjelm (hjelmn_at_[hidden])
Date: 2013-07-16 17:03:32

On Tue, Jul 16, 2013 at 10:22:33PM +0200, George Bosilca wrote:
> Nathan,
> I read your code and it's definitively looking good. I have however few minor issues with your patch.
> 1. MPI_Aint is unsigned as it must represent the difference between two memory arbitrary locations. In your MPI_Type_get_[true_]extent_x you go through size_t possibly reducing it's extent. I would suggest you used ssize_t instead.
> 2. In several other locations size_t is used as a conversion base. In some of these location there is even a comment talking about ssize_t ?

I looked at the code in question and there shouldn't be an issue. Where we want to return MPI_Aint it is never converted to a size_t. The size_t is to ensure that if we return an MPI_Count that the value is never larger than SSIZE_MAX or negative. Am I wrong in assuming MPI_Count can never be negative? If so I can change the checks in MPI_Type_get_[true_]_extent_x to not loose this value.

The other places that use size_t (MPI_Get_elements for example) are in places where I beleive the value will never legally be negative so it is safe to assume the returned value should be MPI_UNDEFINED in those cases. Is there a particular case I should look at?