Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to profile OpenMP bottlenecks

I have a loop that has been parallelized by OpenMP, but due to the nature of the task, there are 4 critical clauses.

What would be the best way to profile the speed up and find out which of the critical clauses (or maybe non-critical(!) ) take up the most time inside the loop?

I use Ubuntu 10.04 with g++ 4.4.3

like image 358
Mikhail Avatar asked Aug 24 '11 19:08

Mikhail


3 Answers

Scalasca is a nice tool for profiling OpenMP (and MPI) codes and analyzing the results. Tau is also very nice but much harder to use. The intel tools, like the vtune, are also good but very expensive.

like image 185
Jonathan Dursi Avatar answered Nov 03 '22 14:11

Jonathan Dursi


Arm MAP has OpenMP and pthreads profiling - and works without needing to instrument or modify your source code. You can see synchronization issues and where threads are spending time to the source line level. The OpenMP profiling blog entry is worth reading.

MAP is widely used for high performance computing as it is also profiles multiprocess applications such as MPI.

like image 44
David Avatar answered Nov 03 '22 15:11

David


OpenMP includes the functions omp_get_wtime() and omp_get_wtick() for measuring timing performance (docs here), I would recommend using these.

Otherwise try a profiler. I prefer the google CPU profiler which can be found here.

There is also the manual way described in this answer.

like image 35
NGaffney Avatar answered Nov 03 '22 15:11

NGaffney