Using valgrind to spot error in mpi code

后端 未结 2 1886
栀梦
栀梦 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:35

    You can never go wrong with a Jonathan Dursi answer but let me just add that with more than one processor it can be a pain to read valgrind output.

    Instead of outputting to the console, dump it to a log file. Of course you can't dump both processes to the same log file. valgrind interprets '%p' as the process id so you get two (or more) log files:

    mpiexec -np 2 valgrind --leak-check=full \
        --show-reachable=yes --log-file=nc.vg.%p ./noncontig_coll2 -fname blah
    

提交回复
热议问题