Memory Leak on MacOS with ff-mpirun

Hello, everyone.

Firstly, I install open-mai on MacOS.

mpirun (Open MPI) 5.0.3

For diffusion-2d.edp When I use ff-mpirun -np 4 diffusion-2d.edp

 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
 Warning: -- Your set of boundary condition is incompatible with the mesh label.
times: compile 0.028738s, execution 0.140543s,  mpirank:1
 ######## We forget of deleting   1 Nb pointer,   0Bytes  ,  mpirank 1, memory leak =4826064
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 1
times: compile 0.028734s, execution 0.139155s,  mpirank:2
 ######## We forget of deleting   1 Nb pointer,   0Bytes  ,  mpirank 2, memory leak =4654432
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 2
times: compile 0.028961s, execution 0.139101s,  mpirank:3
 ######## We forget of deleting   1 Nb pointer,   0Bytes  ,  mpirank 3, memory leak =2325024
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 3
times: compile 1.267290e-01s, execution 1.915500e-02s,  mpirank:0
 ######## We forget of deleting   1 Nb pointer,   0Bytes  ,  mpirank 0, memory leak =4200688
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 0
Ok: Normal End

If I use mpirun -np 4 FreeFem++-mpi diffusion-2d.edp

times: compile 2.360370e-01s, execution 6.631000e-03s,  mpirank:0
 ######## We forget of deleting   5 Nb pointer,   0Bytes  ,  mpirank 0, memory leak =76720
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 0
Ok: Normal End
times: compile 2.350180e-01s, execution 6.796000e-03s,  mpirank:0
 ######## We forget of deleting   5 Nb pointer,   0Bytes  ,  mpirank 0, memory leak =11184
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 0
Ok: Normal End
times: compile 2.381260e-01s, execution 6.856000e-03s,  mpirank:0
 ######## We forget of deleting   5 Nb pointer,   0Bytes  ,  mpirank 0, memory leak =76720
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 0
Ok: Normal End
times: compile 2.382280e-01s, execution 7.626000e-03s,  mpirank:0
 ######## We forget of deleting   5 Nb pointer,   0Bytes  ,  mpirank 0, memory leak =1307024
 CodeAlloc : nb ptr  7502,  size :650272 mpirank: 0
Ok: Normal End

And for other file.edp in hpddm even in examples, both command ff-mpirun -np and mpirun -np will output the result of

######## We forget of deleting   0Nb pointer,   0Bytes  ,  mpirank 0, memory leak =......

I do not know if I need to solve the memory leak, and how to fix it?
Another question, on MacOS, with open mpi, do command ff-mpirun -np and mpirun -np output the same or similar results?

These are false positives. Run with -v 0 and you won’t get any such wrong warnings. If you have a single MPI implementation, ff-mpirun and mpirun should be the same.

I am so sorry, but I do not quite understand what you mean. I am a beginner in PETSc and MPI, so I have a lot of doubts about it.

Could you tell me more about what commands I should type in the terminal to get the correct result and not to have warning and memory leaks?

Thank you very much for your reply!

ff-mpirun -np 4 diffusion-2d.edp -v 0

Yes, I know.

The -v 0 option is used to set the verbosity level of the program’s output, where 0 indicates that all output is turned off except for error messages. The command has executed successfully.

However, I didn’t see any output or log files.

wxj@WXJdeMacBook-Air WXJ-git % ff-mpirun -np 4 FreeFem_example/hpddm/diffusion-2d.edp -v 0
'/Applications/FreeFem++.app/Contents/ff-4.14/bin/mpiexec' -np 4 /Applications/FreeFem++.app/Contents/ff-4.14/bin/FreeFem++-mpi -nw 'FreeFem_example/hpddm/diffusion-2d.edp' -v 0

What are you expecting to get? You should use the example diffusion-2d-PETSc.edp, it is slightly more verbose.

Yes, I run diffusion-2d-PETSc.edp with ff-mpirun -np 4 diffusion-2d-PETSc.edp -v 0, there is no memory leak.

Then, for diffusion-2d.edp and like this without petsc, What is the command that I need?

You need the same command line parameter.

OK, I understand. Thank you very much!