What I am trying to acheive in this simplified code is:
- 2 types of processes (root, and children, ids/rank = 10 and 0-9
respectively)
- init:
- root will listen to children "completed"
- children will listen to root notification when all has completed
- while there is no
What I want to achieve is something like:
- root process listens to children process
- children will listen to root for stop notification
- children starts doing work
- when 1st child completes, notify root
- root then notifies all processes to stop
How can I implement something li
all, self-contained example?
>
>
> On Nov 8, 2012, at 9:42 AM, Lim Jiew Meng wrote:
>
> > I have an int I intend to broadcast from root (rank==(FIELD=0)).
> >
> > int
> > winner
> >
> >
> > if (rank == FIELD) {
> >
> > winner
> > =
I have an int I intend to broadcast from root (rank==(FIELD=0)).
int winner
if (rank == FIELD) {
winner = something;}
MPI_Barrier(MPI_COMM_WORLD);
MPI_Bcast(&winner, 1, MPI_INT, FIELD, MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);if (rank != FIELD) {
cout << rank << " informed that winner