I have a code which works perfect in serial but with mpirun -n 2 ./out
it gives the following error:
./out\': malloc(): smallbin double linked l
Note that with the invocation above,
valgrind --leak-check=yes mpirun -n 2 ./out
you are running valgrind on the program mpirun
, which presumably has been extensively tested and works correctly, and not the program ./out
, which you know to have a problem.
To run valgrind on your test program you will want to do:
mpirun -n 2 valgrind --leak-check=yes ./out
Which uses mpirun to launch 2 processes, each running valgrind --leak-check=yes ./out
.