Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I write from different MPI_Irecv into the same buffer/array at different index positions?

MPI_IRecv(&myArr[0], 5, MPI_INT, 1, MPI_ANY_TAG, MPI_COMM_WORLD, request);
MPI_IRecv(&myArr[5], 5, MPI_INT, 2, MPI_ANY_TAG, MPI_COMM_WORLD, request);
MPI_IRecv(&myArr[10], 5, MPI_INT, 3, MPI_ANY_TAG, MPI_COMM_WORLD, request);

Hi, does c/mpi allow you to write into different areas of the same array from an mpi non-blocking receive? The above code shows roughly what I would like to achieve.

like image 258
user692898 Avatar asked Nov 28 '25 01:11

user692898


1 Answers

Yes. You aren't allowed to read or modify the buffer of a non-blocking communications request until the communications are done; but as far as MPI are concerned, non-overlapping regions of the same array are completely different buffers.

like image 180
Jonathan Dursi Avatar answered Nov 30 '25 15:11

Jonathan Dursi