On Feb 4, 2005, at 7:19 PM, Josh Hursey wrote:
>> Well, I think it is the responsibility of the caller to first check
>> if the call has succeeded and then use the variable.
>
> I agree.
Also, a minor clarification: an MPI implementation is not under any
constraint to set a value in the rank argument upon error. Indeed, in
LAM, we don't touch the rank parameter if there's an error -- we just
return an error.
>> Is this the only reason for ranks and sizes being signed instead of
>> unsigned - 'cause smb might forget to check the return value of a
>> function?
>
> This is not the only reason. One of the main reasons is so that it has
> an equivalent interface to MPI_Group_rank. See the MPI Forum for more
> details:
> http://www.mpi-forum.org/docs/mpi-11-html/node101.html
> http://www.mpi-forum.org/docs/mpi-11-html/node97.html#Node97
Also, it's for compatibility with Fortran (there's no unsigned integer
in Fortran). There's a bunch of things in MPI that are specifically
there for compatibility with Fortran. :-(
>> And one more question: why do send functions take pointers instead of
>> pointer to constants when they do not change the contents of the
>> pointed to data, or do they?
I'm not sure I understand the question -- the C binding for MPI_Send is:
int MPI_Send(void *buf, int count, MPI_Datatype dtype, int dest,
int tag, MPI_Comm comm)
Which pointers are you referring to? The buffer clearly has to be
passed by pointer.
If you're talking about MPI_Datatype and MPI_Comm, as far as the user
interface is concerned, those are opaque handles, not integers or
pointers. You don't know or care what they are -- just that they are
filled by the MPI implementation as necessary. If you're asking why we
use pointers for MPI_Datatype and MPI_Comm (etc.), that's a different
question (with a longer answer -- I'm happy to answer, but I won't
bother typing it all out unless I know that that's what you're asking
;-) ).
Note that fortran handles *must* be integers because (at least in F77)
Fortran has no concept of a pointer. Indeed, the standard *defines*
that fortran handles must be integers, but makes no such restrictions
for C:
http://www.mpi-forum.org/docs/mpi-20-html/node10.htm#Node10
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|