On 05/31/2017 04:53 PM, Vince Weaver wrote:
> On Tue, 30 May 2017, William Cohen wrote:
> 
>> As a workaround I have been developing a patch that avoids using the 
>> PFM_PMU_MAX and examines the pfm_pmu_get_info return code to determine 
>> if there are might be additional pmu descriptions to scan.  Attached is 
>> the patch.  I have tried it out. It compiles and appears to allow papi 
>> to not care so much about which particular libpfm was used to build 
>> papi.
> 
> The patch is a little more intrusive than I was hoping for, but I'll see 
> that it (or something like it) gets applied.  Is there a quick way of 
> testing it?  Were you using papi_component_avail or something else?
> 
> Mostly your use of forever-looping for loops throws me, I'm more used to a 
> while(1) type idiom.
> 
> Vince
> 


Hi Vince,

Sorry for for the odd for loops.  I did originally code things as while loops, 
but the conditional continue statements would skip the increments causing the 
code to get stuck in an infinite loop.  The odd for loops seemed like the 
easiest solution to ensure that the increments did happen and the loops were 
eventually exited.  I was hoping for the patch to be a bit smaller, but there 
are a few more uses of PFM_PMU_MAX than I expected.

The way that this problem was discovered was compiling papi with an older 
unbundled libpfm on the machine, then running the papi binary on a machine with 
a newer libpfm where the enum for the pmu was larger than or equal to 
PFM_PMU_MAX.  This is pretty easy to replicate via libpfm and papi built via 
rpm on fedora.  For example building papi with libpfm-4.6 and then on a intel 
skylake machine installing libpfm-4.7 (or newer) and the just built papi.  
Without the patch papi will stop the search for the default pmu before it 
reaches the entries for Intel skylake processor.  Similarly you could use 
libpfm-4.8 on Intel KNL or Intel Goldmont. Figuring out which libpfm versions 
will trigger this can be worked out from http://perfmon2.sourceforge.net/. 
papi_avail will show 0 available presets for machines that should some set of 
preset available if papi doesn't find the pmu events.

-Will

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to