Skip to content

Comments

framework: update maint/genpapifdef.pl to add remaining define's in papiStdEventDefs.h#559

Open
Treece-Burgess wants to merge 1 commit intoicl-utk-edu:masterfrom
Treece-Burgess:02-09-2026-update-genpapifdef
Open

framework: update maint/genpapifdef.pl to add remaining define's in papiStdEventDefs.h#559
Treece-Burgess wants to merge 1 commit intoicl-utk-edu:masterfrom
Treece-Burgess:02-09-2026-update-genpapifdef

Conversation

@Treece-Burgess
Copy link
Contributor

@Treece-Burgess Treece-Burgess commented Feb 10, 2026

Pull Request Description

Currently in the master branch, if you configure with the flag --enable-warnings you will see the following compilation warnings:

avail.F:55:132:

   55 |       do i=0, PAPI_MAX_PRESET_EVENTS-1
      |                                                                                                                                    ^
Warning: ‘papi_max_preset_events’ is used uninitialized [-Wuninitialized]
gcc -Wall -Wextra  -DPAPI_NUM_COMP=3 -O2  -o papi_multiplex_cost papi_multiplex_cost.o cost_utils.o ../libpapi.a -lm 
gfortran -I../testlib -I. -I.. -Wall -Wextra  -DPAPI_NUM_COMP=3 -ffixed-line-length-132 -O1 openmp.F ../testlib/libtestlib.a ../libpapi.a -o openmp  -fopenmp
fmultiplex2.F:85:41:

   85 |          do while ((avail_flag.EQ.0).AND.
      |                                         ^
Warning: ‘papi_max_preset_events’ is used uninitialized [-Wuninitialized]

This is due to the following #define's not being accounted for when creating the fortran header files:

#define PAPI_PRESET_MASK     ((int)0x80000000)
#define PAPI_NATIVE_MASK     ((int)0x40000000)
#define PAPI_UE_MASK		 ((int)0xC0000000)
#define PAPI_PRESET_AND_MASK 0x7FFFFFFF
#define PAPI_NATIVE_AND_MASK 0xBFFFFFFF	/* this masks just the native bit */
#define PAPI_UE_AND_MASK     0x3FFFFFFF

#define PAPI_MAX_PRESET_EVENTS 128		/*The maxmimum number of preset events */
#define PAPI_MAX_USER_EVENTS 50			/*The maxmimum number of user defined events */
#define USER_EVENT_OPERATION_LEN 512	/*The maximum length of the operation string for user defined events */

Along with the above compilation warning's, if you attempt to run avail.F or fmultiplex2.F they will not run properly:

./[ICL:methane ftests]$ ./avail 
 Hardware information and available events
 -----------------------------------------------------------------------------
 Vendor string and code   : GenuineIntel (           1 )
 Model string and code    : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz (          85 )
 CPU revision             :    4.00000000    
 CPU Megahertz            :    3700.00000    
 CPUs in an SMP node      :           36
 Nodes in the system      :            2
 Total CPUs in the system :           72
 -----------------------------------------------------------------------------
    Name        Code    Avail Deriv              Description                        (note)
 -----------------------------------------------------------------------------
avail.F                                  PASSED
[ICL:methane ftests]$ ./fmultiplex2 
multiplex2: Using *** iterations
 case1: Does PAPI_multiplex_init() handle lots of events?
 Checking for available events...
fmultiplex2.F                            SKIPPED
 Line #          98
 SGI requires root permissions for this test

This PR updates maint/genpapifdef.pl to account for the aforementioned missing #define's.

Testing

This pull request was tested on Methane at ICL

  • PAPI compilation: ✅ (compilation warnings now do not exist)
  • avail.F: ✅ (outputs presets)
  • fmultiplex2.F: ✅ (passes)
  • PAPI utilities*: ✅

* - papi_component_avail, papi_native_avail, papi_command_line

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

@Treece-Burgess Treece-Burgess added type-bug Issues discussing bugs or PRs fixing bugs status-ready-for-review PR is ready to be reviewed labels Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status-ready-for-review PR is ready to be reviewed type-bug Issues discussing bugs or PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant