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 sentences.

What would be the best way to profile the speed and find out which of the critical sentences (or possibly non-critical (!)) Takes the longest time inside the loop?

I am using Ubuntu 10.04 with g ++ 4.4.3

+6
source share
3 answers

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

Otherwise, try the profiler. I prefer the Google profiler, which can be found here .

There is also a manual method described in this answer.

+2
source

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

+4
source

Arm MAP has OpenMP and pthreads profiling - and works without using a tool or changing source code. You can see synchronization problems and threads are wasting time at the source line level. OpenMP profiling blog entry is worth reading.

MAP is widely used for high-performance computing because it also supports multiprocessor applications such as MPI.

+3
source

Source: https://habr.com/ru/post/895796/


All Articles