Gwinel / likwid

Automatically exported from code.google.com/p/likwid
GNU General Public License v3.0
0 stars 0 forks source link

Marker API and OpenMP #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Recently I started to use likwid again and tried to profile my OpenMP-enabled 
code with the marker API. While profiling without markers works nicely, as soon 
as I switch on the marker support things break. The reported errors are:

ERROR: Is the number of threads for likwid-perfctr equal to the number in the 
measured application?
likwid_markerInit and likwid_markerClose must be called in serial region.
ERROR - [./src/perfmon.c:287] Number of threads 1 in marker file unequal to 
number of threads in likwid-perfCtr 8

To verify this is not a problem with my code, I performed the same tests using 
the testmarker-omp.c example shipped with likwid. Same situation here. The 
setup I use is an Intel i7 920 CPU with direct MSR access.

When browsing the likwid wiki, I only found an outdated section on using 
markers and OpenMP. Is the combination of marker API and OpenMP supposed to 
work at all?

Original issue reported on code.google.com by severins...@gmail.com on 4 Nov 2012 at 4:13

GoogleCodeExporter commented 9 years ago
I wil provide a Development snapshot this week since I need a few more weeks 
for the stable release.

The WIKI will be updated soon. Still the description of using the NEW  Marker 
API in the WIKI is also valid for OpenMP and should work.  Using the Marker API 
together with the msr accessdaemon is broken in the current release. But direct 
access of the MSR device files should work.

The error message you reported is caused by a difference between the number of 
threads which entered the parallel marker region and  the core list you 
provided on the command line for likwid-perfctr.

So if you have a.e.  -C S0:0-3, also you should only use 4 threads. 

Original comment by jan.trei...@gmail.com on 5 Nov 2012 at 8:17

GoogleCodeExporter commented 9 years ago
Thanks for the update. It turned out, an explicit call to omp_set_num_threads() 
is required when using likwid-perfctr.

Original comment by severins...@gmail.com on 5 Nov 2012 at 2:36

GoogleCodeExporter commented 9 years ago
Added updated documentation in WIKI.

Original comment by jan.trei...@gmail.com on 30 Nov 2012 at 7:15

GoogleCodeExporter commented 9 years ago
Added updated documentation in WIKI.

Original comment by jan.trei...@gmail.com on 30 Nov 2012 at 7:15