0
votes

I would like to profile my parallel code (both mpi and omp)

I found out that Callgrind is very easy to use and analyze (using Kcachegrind) for serial code as it can give you the relative time spent on different functions.

What would it give me when running a parallel code? Would it only monitor the master process or will it sum over all process?

Can it detect deadlocks or place where one process is waiting to another?

Is there a better tool to use when profiling a parallel code?

1

1 Answers

0
votes

According to 'Valgrind User Manual' Valgrind runs all threads serially as detailed in Support for Threads . Callgrind can monitor the overall access to functions but it's profile will be Inadequate.

regarding mpirun, there is a complete section describing Valgrind Memcheck performance with MPI: 4.9. Debugging MPI Parallel Programs with Valgrind , I dont know it's exact effect on Callgrind but I feel that these kind of profiling should remain serial