Collective Communication and Synchronization



next up previous contents
Next: Ambiguous Communications and Up: Portable Programming with Previous: Dependency on Buffering

Collective Communication and Synchronization

  collective, semantics of The MPI specification purposefully does not mandate whether or not collective communication operations have the side effect of synchronizing the processes over which they operate. Thus, in one valid implementation collective communication operations may synchronize processes, while in another equally valid implementation they do not. Portable MPI programs, therefore, must not rely on whether or not collective communication operations synchronize processes. Thus, the following assumptions must be avoided.

  1. We assume MPI_Bcast() acts as a barrier synchronization and it doesn't.

    MPI_Irecv (buf2, count, MPI_INT, anticlock, tag, comm, &status);
    MPI_Bcast (buf3, 1, MPI_CHAR, 0, comm);
    MPI_Rsend (buf1, count, MPI_INT, clock, tag, comm);

    Here if we want to perform the send in ready mode we must be certain that the receive has already been initiated at the destination. The above code is nonportable because if the broadcast does not act as a barrier synchronization we cannot be sure this is the case.

  2. We assume that MPI_Bcast() does not act as a barrier synchronization and it does. Examples of this case are given in Examples gif, gif, and gif starting on page gif.



Jack Dongarra
Fri Sep 1 06:16:55 EDT 1995