Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Basic Scatter Operation
From: Matt Hughes ([hidden])
Date: 2008-12-09 19:28:15

2008/12/9 Kevin Anthony Joy <kjoy96_at_[hidden]>:
> if (rank==0) { /// REMOVE THIS IF
> MPI::COMM_WORLD.Scatter(
> stat,
> 1,
> &test3,
> 1,
> 0);
> }

Hi Kevin. I see you are mixing C and C++ calls. It is probably best
to stick with one or the other. Anyway, the source of your problem is
that the peers that are supposed to be receiving data from the scatter
don't call MPI_Scatter! MPI_Scatter is a collective operation,
meaning that all processes in the communicator have to call it.
Remove the if block around the scatter call, and you should get the
results you expect.