Newsgroups: comp.parallel.pvm
From: sits@cs.anu.edu.au (David Sitsky)
Subject: Re: MPI_Bcast problems?
Organization: Australian National University
Date: 19 Jun 1994 23:31:17 GMT
Message-ID: <2u2kg5INN9sb@dubhe.anu.edu.au>

In article rmc@msuinfo.cl.msu.edu, nupairoj@cps.msu.edu (Natawut Nupairoj) writes:
> In article <2tjlb9INNhgv@dubhe.anu.edu.au>, sits@cs.anu.edu.au (David Sitsky)
> writes:
> [stuffes deleted]
> |> 
> |> Although a non blocking MPI_Bcast operation may solve this problem, I'm just
> |> curious why the MPI standard doesn't include a function MPI_Mcast which
> |> has the same semantics as pvm_mcast (ie non-collective call but message appears
> |> as an ordinary message to the destination processes).
> |> 
> |> This seems to me like an important function that isn't present in MPI.  Is there
> |> some reason why it wasn't included?  Are there any workarounds?
> 
> MPI has a "group" concept which allows you to create your own communication
> domain.  Thus, to do multicast in MPI, you can just create a new group and then
> use MPI_Bcast.

Its important to distinguish what is required here - I just wanted a broadcast
operation which WASN'T collective, since it isn't know in advance in the application
when a given process is going to broadcast a message.

Although a function like MPI_Mcast can be written on top of the MPI point-to-point
primitives, this is not good enough on parallel machines which could have
optimized such an operation (such as the Fujitsu AP1000 which has its own
broadcast network).

To clarify the situation - the main body of a process could be something like
this (or alternatively non-blocking receives could be used).

while(1) {

   MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, some_comm, &flag, &status);

   if (flag) {
       /* Receive the message and process it */
   }
   else {
       /* Do some other work */
   }
}

The point is that a broadcasted message from another process should appear 
indistinguishable from an ordinary point-to-point message in order for this
code to work.  Since it is not known in advance when a broadcasted message is
sent, it is pointless to call MPI_Bcast since it will block this process until
the other required processes call MPI_Bcast - which is unacceptable.

A nonblocking MPI_Bcast could however be used in this code effectively... but
it isn't provided in MPI.  Does anyone know if this will be included in MPI-II?

Cheers,
David Sitsky









