Will my program require an increase in memory if I do not associate MPI_Isend with MPI_Wait?

I parallelized Fortran code using MPI. At common points, I send all the data to the buffer using MPI_Isend from all the processes in the model. Then each process goes and collects the data it needs using MPI_Recv. Since MPI_Recv blocks, I know that every process receives the data it needs before proceeding with its calculations. So I just ignored the request code that MPI_Isend gives me. I set it to some whole that I do not preserve. I never call MPI_Wait. When I run my code, I notice that it is gaining more memory at each iteration, and I wonder if it’s because I don’t call MPI_Wait, as the MPI_Wait documentation says:

If the communication object associated with this request was created by a non-blocking call to send or receive, then the object is released by calling MPI_WAIT, and the request handle is set to MPI_REQUEST_NULL.

Why do you think my program consumes more memory throughout the cycle?

+4
source share
1 answer

An MPI_Request associated with MPI communication functions, such as your MPI_ISend , will be allocated memory and should be cleared to MPI (as opposed to delete ).

The memory will not be returned until one of three things happens:

  • A wait such as MPI_Wait completes on request, freeing it.
  • The MPI_Test function returns success, also freeing it.
  • The request is freed using MPI_Request_free .

You can release the active request (i.e. MPI_Request for a message that is not finished) that will continue to send, but MPI_Request will no longer be valid for any applications, such as testing, waiting, etc.

+4
source

Source: https://habr.com/ru/post/1495018/


All Articles