Using valgrind to spot error in mpi code

后端 未结 2 1883
栀梦
栀梦 2020-12-14 22:34

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         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 23:22

    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.

提交回复
热议问题