[Mpi3-bwcompat] MPI_Size and non-count int parameters

Solt, David George david.solt at [hidden]
Tue Oct 5 00:45:42 CDT 2010



For MPI_Type_create_struct, I really think that int is the correct type for a count.  When we want to store some arbitrary integer value on a computer, we use an int to do that.   To start saying that we expect structures to have so many fields that they won't fit into an int, then I think we are basically saying that int is useless and should never be used anywhere.   When that is the case, its int's fault for not being large enough to hold anything useful, not our fault.  The other argument is that I think MPI_Size was supposed to be a number of bytes, which wouldn't fit the use here.

MPI_Type_get_envelope....  I think this should be easy.  Is there any datatype creation call to create MYTYPE such that MPI_Type_get_envelope(MYTYPE,...) could possibly cause one of the 3 output's to overflow.  If you look at the list of possible values for ni, na and nd (i.e max_integers, max_addresses, max_datatypes), these are often constants, but sometimes are dynamic, such as:

If combiner is MPI_COMBINER_INDEXED then ni = 2*count+1.   If we look at MPI_Type_indexed, we see that count is only an int, so this case does not require max_integers to be anything but an int.   But we have to look at every case...

If combiner is MPI_COMBINER_HINDEXED_INTEGER or MPI_COMBINER_HINDEXED than ni = count+1, na = count, but count for both of these routines is also an int.

If combiner is MPI_COMBINER_INDEXED_BLOCK then ni = count+2, but count for this routine is an int.

If combiner is MPI_COMBINER_STRUCT_INTEGER or MPI_COMBINER_STRUCT then ni = count+1, na = count, nd = count, which I recommend count=int in this case.

If combiner is MPI_COMBINER_SUBARRAY then ni = 3*ndims+2.  Ndims is an int.

If combiner is MPI_COMBINER_DARRAY then ni = 4*ndims+4.  Ndims is an int.

So in all cases where these values are not constants, they are formed from datatype creation functions taking int's in the associated parameter location.

Dave

-----Original Message-----
From: mpi3-bwcompat-bounces_at_[hidden] [mailto:mpi3-bwcompat-bounces_at_[hidden]] On Behalf Of Fab Tillier
Sent: Tuesday, October 05, 2010 12:00 AM
To: MPI-3 backwards compatability WG
Subject: [Mpi3-bwcompat] MPI_Size and non-count int parameters

Should MPI_Size be used where one would likely use size_t?

For example, MPI_Type_create_struct (page 86), should the count parameter be MPI_Size?  Likewise, should the three integers output by MPI_Type_get_envelope (page 105) be MPI_Size?

Or is this yet another distinct type, and if so, should we try to cover it in this ticket?

Thanks,
-Fab

_______________________________________________
Mpi3-bwcompat mailing list
Mpi3-bwcompat_at_[hidden]
http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-bwcompat



More information about the Mpi3-bwcompat mailing list