mpi - sending and receiving multiple elements via MPI_Send/recv -


I am starting to learn MPI I'm just starting to make simple examples: I have a rectangle that is divided into two sub- The box is divided into i. I tell the N / 2 particles in each box (summarizing whole N particles). I'm using two processes / core to do this work. The first core handles the first sub-box and the other core is the second sub-box. During the time, the particles cross from one sub-box to the other. I am sure that I will have to use MPI_Send and MPI_Recv to do this work. But what I can not understand if I have to cross multiple particles at all times (from one core to the other), how do I use MPI_Send / Recv or MPI_Sendrecv efficiently? I forgot to say that I do not know the number of particles every time. Sorry if the question is very simple / silly.

There are a number of options:

  • In all the sub-boxes To exchange a number of particles you can do a bit easier to use a MPI_ALLTOALL then use point-to-point communication to communicate about real particles.
  • You can use the neighborhood group to communicate with neighbors with your code MPI_NEIGHBOR_ALLTOALL
  • You can exchange exchanges Use point-to-point non-blocking communication between all neighbors and then the contents of the particles.
  • You can use MPI_PROBE to determine the number of particles

So, yes, this is possible. There are so many options. You probably have to send them. However to learn more about MPI to use any of them.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -