On Tue, Mar 09, 2004 at 12:01:13AM -0800, Lei_at_ICS wrote:
>I have three processors p1, p2, and p3.
>On p1 there is a large array A[10000]
>that needs to be sent to p2 or p3 depending
>on a parameter X which is computed on
>p1. X is not available initially on p2 or p3.
>
>if(X < 0.5)
> put A[10000] to p2;
>else
> put A[10000] to p3;
p2,p3 could just be sitting in an MPI_Recv waiting for comms from the
root process.
When they get a message they do the work (presumably send a result
back), then get loop back to the MPI_Recv again and wait for the next
work unit.
You can have a zero-length message (or something else special) to tell
the worker processes that they should quit.
I don't see why you need one-sided comms for this problem. Did I miss
something?
Make it an MPI_Irecv and check it periodically if you'd prefer.
The worker nodes can then be doing something else in the mean time.
cheers,
robin
|