The MPI standard describes that buffered sends use the memory available in the buffer between the end of the active message queue and its beginning. Even if messages in the middle of the active message queue are completed, their memory is not reused until all messages before them are also completed.
This sample uses a buffer that is large enough to store three small messages, or two such small messages and a larger one. First, it demonstrates how the buffer is used correctly, then it shows how memory cannot be reused, because the initial message is not completed and blocks the buffer.
Linux*:
Ensure that the corresponding compiler, Intel® MPI Library, and Intel® Trace Analyzer and Collector are already in your PATH
, and complete these steps:
Build the sample:
$ make
Run the sample:
$ make run
Review the output.
Ensure that the corresponding compilers, Microsoft* Visual Studio*, Intel® MPI Library, and Intel® Trace Analyzer and Collector are already in your PATH
, and complete these steps:
Build the sample:
> build.bat release
Run the sample:
> build.bat run
Review the output.