LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Ralf Wildenhues (Ralf.Wildenhues_at_[hidden])
Date: 2004-09-29 10:57:11


* Imran Ahmed khan wrote on Wed, Sep 29, 2004 at 05:37:58PM CEST:
>
> if(rank == 0)
> {
> strcpy(message, "Hello, world");
> MPI_Bcast(message,20,MPI_CHAR,0,MPI_COMM_WORLD);
>
> }
> else
> {
> MPI_Recv(message, 20, MPI_CHAR, 0,type, MPI_COMM_WORLD, &status);

The receivers thould also call MPI_Bcast here. The sender is
distinguished by his rank already. No need to do that yourself.
Similar pattern for all other collective communication routines.

Regards,
Ralf