LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Angel Tsankov (fn42551_at_[hidden])
Date: 2005-02-04 17:52:03


>>> Further, if an error is reached in MPI_Comm_rank, the code needs to set
>>> the value of the variable to a negative number, since all other values
>>> would possibly reference a valid rank.
>>
>> If an error is reached in MPI_Comm_rank or MPI_Comm_size, the program
>> should be aborted (by default). So, what is the point in setting the
>> variable (rank or size) to a negative value since neither of those
>> functions will return?
>>
>
> Mostly for the non-default case. :-) By default, you may never see this
> value propagated, but when you have an error handler in place other than
> MPI_ERRORS_ARE_FATAL we need to return a value for the variable. So if you
> happen not to catch that MPI_Comm_rank failed, we want to provide a value
> that is not valid for use as a rank, so something < 0.
>

Well, I think it is the responsibility of the caller to first check if the
call has succeeded and then use the variable.
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?

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?