Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template: add template for new components #58

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

gcongiu
Copy link
Contributor

@gcongiu gcongiu commented Jul 26, 2023

Pull Request Description

This PR adds a more complex example of component design that focuses on component extendability. This component also showcases a simple example of qualifier support through the TEMPLATE_FUNCTION event that supports exponential and linear functions. Powers of 2 are returned at every call of PAPI_read when the exponential function is selected by the user. Incremental values from 1 onwards are returned at every call of PAPI_read when the linear function is selected.

$ utils/papi_component_avail
Available components and hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.0.1.0
Operating system         : Linux 6.1.62-1.el9.elrepo.x86_64
Vendor string and code   : AuthenticAMD (2, 0x2)
Model string and code    : AMD EPYC 7413 24-Core Processor (1, 0x1)
CPU revision             : 1.000000
CPUID                    : Family/Model/Stepping 25/1/1, 0x19/0x01/0x01
CPU Max MHz              : 3630
CPU Min MHz              : 1500
Total cores              : 96
SMT threads per core     : 2
Cores per socket         : 24
Sockets                  : 2
Cores per NUMA region    : 48
NUMA regions             : 2
Running in a VM          : no
Number Hardware Counters : 5
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

Compiled-in components:
Name:   perf_event              Linux perf_event CPU counters
Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
Name:   template                Template component for new components
Name:   sysdetect               System info detection component

Active components:
Name:   perf_event              Linux perf_event CPU counters
                                Native: 145, Preset: 27, Counters: 5
                                PMUs supported: perf, perf_raw, amd64_fam19h_zen3

Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
                                Native: 4, Preset: 0, Counters: 7
                                PMUs supported: amd64_rapl, amd64_fam19h_zen3_l3

Name:   template                Template component for new components
                                Native: 3, Preset: 0, Counters: 3

Name:   sysdetect               System info detection component
                                Native: 0, Preset: 0, Counters: 0


--------------------------------------------------------------------------------


$ utils/papi_native_avail
...
 Native Events in Component: template
===============================================================================
| templ:::TEMPLATE_ZERO                                                        |
|            This is a template counter, that always returns 0                 |
|     :device=0                                                                |
|            Mandatory device qualifier [0,1,2,3,4,5,6,7]                      |
--------------------------------------------------------------------------------
| templ:::TEMPLATE_CONSTANT                                                    |
|            This is a template counter, that always returns a constant value o|
|            f 42                                                              |
|     :device=0                                                                |
|            Mandatory device qualifier [0,1,2,3,4,5,6,7]                      |
--------------------------------------------------------------------------------
| templ:::TEMPLATE_FUNCTION                                                    |
|            This is a template counter, that allows for different functions   |
|     :device=0                                                                |
|            Mandatory device qualifier [0,1,2,3,4,5,6,7]                      |
|     :function=exp                                                            |
|            Mandatory function qualifier (exp,sum)                            |
===============================================================================
 Native Events in Component: sysdetect
===============================================================================

Total events reported: 152

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

@gcongiu gcongiu requested a review from adanalis August 18, 2023 09:24
@gcongiu gcongiu force-pushed the 2023.07.21_template branch 4 times, most recently from 85ae910 to 88912b3 Compare November 29, 2023 20:05
@gcongiu gcongiu marked this pull request as ready for review November 29, 2023 20:05
@gcongiu gcongiu force-pushed the 2023.07.21_template branch 4 times, most recently from 0a54ead to d7160fc Compare November 30, 2023 14:41
@gcongiu gcongiu added this to the PAPI 7.1.0 release milestone Nov 30, 2023
@gcongiu gcongiu merged commit af78e55 into icl-utk-edu:master Dec 4, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants