On Feb 4, 2005, at 4:08 PM, Angel Tsankov wrote:
>> 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.
----
Josh Hursey
jjhursey_at_[hidden]
http://www.lam-mpi.org/
|