From 616bd8fb63685476f69ecbb66c73d781e88d6480 Mon Sep 17 00:00:00 2001 From: Cristian-Vasile Achim <66278390+csccva@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:11:24 +0300 Subject: [PATCH] Update 10-further-mpi-topics.md --- mpi/docs/10-further-mpi-topics.md | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/mpi/docs/10-further-mpi-topics.md b/mpi/docs/10-further-mpi-topics.md index 911cad7f6..07a6add90 100644 --- a/mpi/docs/10-further-mpi-topics.md +++ b/mpi/docs/10-further-mpi-topics.md @@ -12,3 +12,60 @@ lang: en - Intercommunicators - Point-to-point communication modes - Dynamic process creation + + + +# Persistent communication {.section} + +# Persistent communication + +- Often a communication with same argument list is repeatedly executed +- It may be possible to optimize such pattern by persistent communication requests + - Can be thought as a ”communication port” +- Three separate phases: + 1. Inititation of communication + 2. Starting of communication + 3. Completing communication +- Recently published MPI 4.0 includes also persistent collectives + - Not supported by all implementations yet + +# Persistent communication + +- Inititiate communication by creating requests + - `MPI_Send_init` and `MPI_Recv_init` + - Same arguments as in `MPI_Isend` and `MPI_Irecv` +- Start communication + - `MPI_Start` / `MPI_Startall` + - Request or array of requests as argument +- Complete communication + - `MPI_Wait` / `MPI_Waitall` + - Same as in standard non-blocking communication + +# Persistent point-to-point communication + +```c +MPI_Request recv_req, send_req; +... +// Initialize send/request objects +MPI_Recv_init(buf1, cnt, MPI_DOUBLE, src, tag, MPI_COMM_WORLD, &recv_req); +MPI_Send_init(buf2, cnt, MPI_DOUBLE, dst, tag, MPI_COMM_WORLD, &send_req); +for (int i=1; i