0
votes

In my C++ application, I should share information among the process every time. It is working well using MPI_Send and MPI_Recv, but in my work, it is unnecessary the "synchronization barrier" formed by the process when send/recv messages each other. Even though using the type MPI_Isend etc, there is a moment in the program where happen the "synchronization barrier".

A solution found was to put the information on files (to share data without messages) in order to the process can get/put the data without waiting for another to arrive at a specific point of code. It works as well, but it make the program lose time performance and the idea is exactly the opposite.

Thus, There is a space of memory (or way) that could work similarly a file application discribed above? Without a need to make the process communicate by messages and that to be security?

PS: "synchronization barrier" I mean a time the process have to wait for another to send/recv information.

1
If all the processes are on a single machine, you could use POSIX Shared Memory.Mark Setchell
@MarkSetchell if the OP is limited to a single machine, and doesn't want to use explicit messages, he shouldn't use MPI in the first place.Zulan
@Zulan I agree and that is why I didn't put it as an answer. However, if he has already written his application using MPI and just wants to speed up parts of it by sharing some memory my suggestion may help.Mark Setchell
@MarkSetchell thank you. But I using more than one machine.GLMF

1 Answers

1
votes

Yes, it is possible to access memory without synchronization with MPI. This is called one-sided communication or RMA (remote memory access). Memory regions, called windows, has to be explicitly made available to this, e.g. using MPI_Win_create. Memory access is explicit using functions like MPI_Put and MPI_Get. Note that each of them is non-blocking, and data movement must be explicitly synchronized. Overall there is quite a bit of boilerplate and pitfalls, so try to read the materials carefully.

Here is a more detailed introduction.