Given a situation where master process A spawns a set of worker processes B, who each spawn their own unique worker process C, how can I open a communicator between C to A?
I'm trying to create a loop, using mpi4py, between several pieces of code that were written separately from one another while minimizing modifications to the codes. So, the general framework of the MPI code is going to be:
- Master A (one process) spawns 8 processes of worker B, and scatters an array to them.
- Each B process spawns a worker C, does some manipulation to the array, and broadcasts it to their own worker.
- Each worker C manipulates the array in their own way, and then (ideally) master A gathers an array back from each of C's arrays.
I know this will involve opening an intercommunicator between existing processes, possibly using group communication. What would be the best way to accomplish this?
Thank you.