[Mpi-forum] Anomolies for MPI_UNWEIGHTED

Torsten Hoefler htor at illinois.edu
Mon May 10 11:21:00 CDT 2010

Hi Dick,
>    1) MPI 2.2 suggests that MPI_UNWEIGHTED is probably NULL in C. It also
>    says that all participants must either provide weighs for edges they
>    define or must use MPI_UNWEIGHTED. When some task has no edges to specify,
>    the length of its weights arrays are 0. The natural thing to do is to pass
>    NULL for the weights array address if its length is 0. How would the
>    implementation know if the user intended to pass MPI_UNWEIGHTED vs
>    ordinary NULL?
The degrees would be 0 in this case. Also, why does the MPI library need
to know? It would never look at the weights array if all {in,out}degrees
are 0.

>    I suppose an allreduce that confirms all participants passed NULL (i.e.
>    guess that NULL means MPI_UNWEIGHTED and test that guess) would work. If
>    any process passed non-NULL then the local NULL is deduced to mean an
>    empty array rather than MPI_UNWEIGHTED. Yuch. That requires treating the
>    address of an array as significant, even if the user said it is empty .
>    I.E. an empty array with a garbage address is OK if MPI_UNWEIGTHED was not
>    intended but an error if it was (because the address != MPI_UNWEIGHTED)
The standard defines that specifying edge weights mixed with
MPI_UNWEIGHTED is erroneous. If you really want to check, it should only
include the processes that actually contribute edges, all others would
not matter. 

>    --- I think the suggestion that MPI_UNWEIGTHED is probably NULL is
>    inappropriate.
I agree. This statement could be misleading. But the phrasing is not
mandatory "one would expect". We could just remove this sentence. Do you
want to file a ticket?

>    2) We say that MPI_UNWEIGHTED is the same as saying all mentioned edges
>    have "(effectively no) weight". I would assume an edge that is not
>    mentioned also has "(effectively no) weight" so why would I expect any
>    edge that is mentioned as having "no weight" to be treated differently
>    than another that has "no weight" but was not mentioned?
"no weight" does not mean "zero weight". This is mostly to emulate the
(non-scalable) MPI-2.1 interface. We chose "effectively no weight"
because that applies in a graph-theoretic context (if all edges have
unit weight, they might treated as unweighted edges by an algorithm).

>    -- We should probably say "All specified edges have the same positive
>    weight and any edge not specified is assumed to have no weight.".
Edges that are not specified don't exist. I would see this as two
domains, edges and weights. No weight doesn't imply no edge.

All the Best,

 bash$ :(){ :|:&};: --------------------- http://www.unixer.de/ -----
Torsten Hoefler         | Research Associate
Blue Waters Directorate | University of Illinois
1205 W Clark Street     | Urbana, IL, 61801
NCSA Building           | +01 (217) 244-7736

More information about the mpi-forum mailing list