0

About the Remote Access Memory in MPI 3.0, there are two communication calls: MPI_Put and MPI_Get. I use the following to put the local data to shared memory (for illustration, I copied some statements from https://software.intel.com/en-us/blogs/2014/08/06/one-sided-communication):

 if (id < num_procs-1)
      MPI_Put(&localbuffer[0], NUM_ELEMENT, MPI_INT, id+1, 0, NUM_ELEMENT, MPI_INT, win);
   else
      MPI_Put(&localbuffer[0], NUM_ELEMENT, MPI_INT, 0, 0, NUM_ELEMENT, MPI_INT, win);

Here num_procs is the number of processor, and id is processor rank. They are respectively returned from:

   MPI_Comm_rank(MPI_COMM_WORLD, &id);
   MPI_Comm_size(MPI_COMM_WORLD, &num_procs);

After MPI_Put, the data from each processor should be put in the shared memory. Then my codes would like to get the data from this shared memory using

if (id != 0)
      MPI_Get(&localbuffer[0], NUM_ELEMENT_get, MPI_INT, id-1, 0, NUM_ELEMENT, MPI_INT, win);
   else
      MPI_Get(&localbuffer[0], NUM_ELEMENT_get, MPI_INT, num_procs-1, 0, NUM_ELEMENT, MPI_INT, win);

My question is: is it possible for me to run cases with NUM_ELEMENT_get different from NUM_ELEMENT? This means that the same processors will get the different number of data from the shared memory compared to what they send. Another problem for this that the data the individual processor get may be sent from different processors. So how to specify the argument of id-1 and num_procs-1 in the above MPI_Get calling? I have not tried to implement this but am thinking about the designing of the MPI implementations in my codes.

Thank you so much.

Hristo Iliev
  • 72,659
  • 12
  • 135
  • 186
flame
  • 1
  • For clarity, I put an example here. Let us say 4 processors send the different number of data to shared memory. Their locations in this shared memory are continuous. The number of dataset they send is x1, x2, x3 and x4. Then they would like to get different numbers of dataset from this memory, i.e. y1, y2, y3 and y4. x1+x2+x3+x4 = y1+y2+y3+y4. – flame Mar 27 '16 at 15:48
  • 1
    *For clarity, I put an example here* For clarity, put your example in your question where it is much easier to lay it out for ease of reading. – High Performance Mark Mar 27 '16 at 17:52
  • To be honest, I still don't really understand what you mean. It behaves like shared memory. So you can get/put whatever data sizes as long as it is in the window. But you have to consider synchronization... I don't think there is a valuable answer to the question as is, but I think if you provide more specific information about your actual use case there could be. – Zulan Mar 28 '16 at 19:48

0 Answers0