Page 1 of 1

PAPI_RES_STL larger than PAPI_TOT_CYC??

PostPosted: Wed Aug 01, 2012 12:36 pm
by JohnnyB
Hi,
quick question on the above mentioned counters. When measuring both events for a memory intensive piece of code (no disk I/O), sometimes PAPI_TOT_CYC is larger than PAPI_RES_STL.
From the PAPI documentation I assumed PAPI_TOT_CYC counts all cycles and therefore, PAPI_RES_STL should be included in them.
Platform is Intel E5450; according to `papi_decode`, PAPI_TOT_CYC is based on native UNHALTED_CORE_CYCLES, and PAPI_RES_STL is based on RESOURCE_STALL:ANY.
I found several sources on google where people measured the % of resource stalls in cycles by RESOURCE_STALL:ANY/UNHALTED_CORE_CYCLES, respectively PAPI_RES_STL/PAPI_TOT_CYC, indicating that RESOURCE_STALL:ANY < UNHALTED_CORE_CYCLES, respectively PAPI_RES_STL < PAPI_TOT_CYC, should hold true.
Any explanation on this behavior would be highly appreciated.
Thanks, Johnny

Re: PAPI_RES_STL larger than PAPI_TOT_CYC??

PostPosted: Wed Aug 01, 2012 2:53 pm
by Aleksr9
Hi, I'm experiencing the same problem and would love an answer.
PAPI_RES_STL and PAPI_L1_DCA have been larger than PAPI_TOT_CYC on a Opteron 6172, where PAPI_TOT_CYC also is based on CPU_CLK_UNHALTED so it should not be possible.

Re: PAPI_RES_STL larger than PAPI_TOT_CYC??

PostPosted: Wed Aug 01, 2012 3:46 pm
by danterpstra
Try using "papi_avail -e PAPI_TOT_CYC", etc. to make sure the event definitions are what you think they are. Then try to count the native events directly to see if they produce consistent results with the PRESET events. Finally do some googling to see if anyone else has observed the same thing and has an explanation. Sometimes there are simply undocumented anomalies in how and what hardware events count. This may be one of those times. I would guess that TOT_CYC is ok, but might be suspicious of the cache and resource stall events.