samgh1230 / likwid

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

Marker API dies with error claiming number of threads is not correct #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using?

3.1.2

Please provide any additional information below.

nate@haswell:~/git/cuckoo$ likwid -m -C2 -g 
PAGE_WALKER_LOADS_DTLB_L2:PMC0,PAGE_WALKER_LOADS_DTLB_L3:PMC1,PAGE_WALKER_LOADS_
DTLB_MEMORY:PMC2,DTLB_LOAD_MISSES_WALK_DURATION:PMC3 ./faster -b 26 -t 1
-------------------------------------------------------------
-------------------------------------------------------------
CPU type:   Intel Core Haswell processor
CPU clock:  3.39 GHz
-------------------------------------------------------------
./faster -b 26 -t 1
header:
ctx: 677391fd32b7d596 40d61df8a69094f7 78659bfd2ca1c282 50dc0bfbb1809ee9
size: 67108864
Left 0: 42414236
Right 0: 19874998
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:303] Number of threads 0 in marker file unequal to 
number of threads in likwid-perfCtr 1

Relevant portion of instrumented source:

    likwid_markerInit();

    siphash_ctx *ctx = malloc(sizeof(siphash_ctx));
    setheader(ctx, header);

    uint32_t size = 1 << bitsinhash;
    uint32_t *seen = mmap_huge(size *  sizeof(typeof(*seen)));
    xmm_t *live = malloc(size * sizeof(typeof(*live)));
    uint32_t numLive = calcInitial(ctx, size, live);

    likwid_markerThreadInit();
    for (int i = 0; i < trimcount; i++) {
        memset(seen, 0, size * sizeof(typeof(*seen)));
        likwid_markerStartRegion("Left");
        numLive = trimLeft(ctx, seen, numLive, live);
    likwid_markerStopRegion("Left");
         memset(seen, 0, size * sizeof(typeof(*seen)));
        likwid_markerStartRegion("Right");
        numLive = trimRight(ctx, seen, numLive, live);
        likwid_markerStopRegion("Right");
     }

    likwid_markerClose();

This may well be related to Issue 164.  I don't yet have a workaround.

Original issue reported on code.google.com by n...@verse.com on 8 Sep 2014 at 8:58

GoogleCodeExporter commented 9 years ago
My fault --- this is not a bug.  I tripped myself up by putting the marker 
start and stop commands in the wrong ifdef.     If you have no regions defined, 
you get this message.  Might be good to change the error message to say "No 
marker regions found" if this is the cause.

Original comment by n...@verse.com on 8 Sep 2014 at 9:07

GoogleCodeExporter commented 9 years ago
Hi Nate,

I added a check to get the number of regions defined in the result file to 
print an error message. The error handling of the 3.X functions and the printed 
error messages are mostly not intuitive, thanks for the hint.

Greetings,
Thomas

Original comment by Thomas.R...@googlemail.com on 10 Sep 2014 at 8:31