HPCE / hpce-2017-cw6

2 stars 17 forks source link

Sanity tests running with -pg flag #50

Open roastedpork opened 6 years ago

roastedpork commented 6 years ago

Based on my experience on CW6, compiling the parallel version of the code (TBB) with the -pg flag leads to worse performance than the original serial version. I reasoned that it might be due to the profiler running atomic operations, resulting in a parallel execution twice that of the original version. Without the -pg flag, I was able to see significant speedups in my implementations.

Has anyone else experienced this issue? And would it be possible to deactivate the profiler for subsequent runs?

m8pple commented 6 years ago

Yes, instrumented profiling usually will lead to worse performance in multi-threaded code - I think you're right, it is the atomics used in order to update the data-structure which records where time was spent. That's why in the lecture we could see the mcount overhead when running the instrumented version under perf.

gprof is mainly used for initial sequential explorations - once you get a good handle on where time is spent, you'd usually disable it, and certainly for the final release build you'd want it off.

But if you want to turn it off, then it is up to you - I rely completely on your makefile, so the -pg flag will only be applied if you have chosen to enable it.