Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

Memory leaks in Intel MPI 2021.13

V-T
New Contributor I
516 Views

Consider the following minimal working example:

 

program p
    use mpi_f08
    call mpi_init(i)
    call mpi_finalize(i)
end

 

The code was compiled with `mpiifx` (`ifx` 2024.2.1 and IntelMPI 2021.13) and the `-fsanitize=address` flag. Running the executable causes a memory leak of 188 bytes in 7 allocations. The allocation sites for 6 of them are unknown, but the remaining one was allocated in `__intel_sse4_strdup` (37 bytes) in `compiler/2024.2/lib/libintlc.so.5`. What's the reason for these leaks?

Labels (2)
0 Kudos
2 Replies
taehunkim
Employee
434 Views
Hi, 
The memory leaks you're observing are likely due to the interaction between the Intel Fortran compiler, the Intel MPI library, and the AddressSanitizer tool. AddressSanitizer is a runtime memory error detector that can sometimes report false positives or benign leaks, especially when dealing with complex libraries and runtime environments like MPI.
Here are a few potential reasons for the leaks:

 

  • Internal Allocations by MPI Library: MPI libraries often perform internal allocations for managing communication buffers, handles, and other resources. These allocations might not be cleaned up in a way that AddressSanitizer can track, leading to reports of memory leaks.
  • Compiler Runtime Libraries: The Intel Fortran compiler's runtime libraries (like libintlc.so.5) might perform internal allocations for various purposes, such as string handling, error messages, or other runtime support. These allocations might not be freed explicitly, especially if they are intended to persist for the lifetime of the program.
  • AddressSanitizer Limitations: AddressSanitizer might not fully understand the lifecycle of certain allocations made by the MPI library or the compiler's runtime. This can result in false positives where AddressSanitizer reports memory leaks that are not actual leaks in the context of the program's execution.

Thanks

0 Kudos
V-T
New Contributor I
362 Views

You say, these can be "potential reasons for the leaks", but are you sure these leaks are not actual bugs in the library? I've already found and reported several bugs in the IntelLLVM compiler. Likewise, there is no guarantee that Intel MPI is error-free. Can you check it, if possible?

(By the way, was this answer generated with a chatbot? Some sentences as well as the formatting and the style of bullet lists are identical to the answer I'm getting from ChatGPT by copy-pasting my question.)

0 Kudos
Reply