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.