I have a question about the dynamic nature of MPI-2.
My (potential) MPI applications starts up with 1 process and then spawns a
random number of "slave" tasks. As I understand it, each spawn returns an
intercommunicator. So if I spawn 10 seperate slaves, I have 10
intercommunicators.
My question is this. If the "master" process (the one that spawned the
slaves) needed to listen for incoming messages from ANY of the slaves, what
would be the best way to do this? Currently, I iterate through EACH
communicator and do a probe. If a message is there, I receive it. But I have
read that probes are bad and it seems CPU intensive anyways to continuously
walk through every communciator (what if I have 1000 slaves??)
I remember than in PVM, I could just do a single recv and use ANY_SOURCE. I
think there is something similar in MPI, but this is complicated by the fact
that I have potentially *many* intercomms, not a bunch of processes within a
single intercomm.
Any thoughts?
Thanks,
Andy
|