I am having trouble finding a way to implement communication between processes using MPI. I have a cube split up into sub-cubes and each process is in charge of calculations over a certain subset of these sub-cubes. Inside the sub-cubes are particles that are moved around during the simulation. My question is this:
How can I implement a communication routine so that if a particle moves outside a process' subset of sub-cubes it will send the data of that particle to another process.
The send part is easy, my trouble is I don't know how to get the other process to receive the data. Any help is greatly appreciated.