Skip to content

PAPI examples: Update src/examples to remove compilation warnings and properly run#614

Open
Treece-Burgess wants to merge 1 commit into
icl-utk-edu:masterfrom
Treece-Burgess:06-03-2026-src-examples-comp-warnings
Open

PAPI examples: Update src/examples to remove compilation warnings and properly run#614
Treece-Burgess wants to merge 1 commit into
icl-utk-edu:masterfrom
Treece-Burgess:06-03-2026-src-examples-comp-warnings

Conversation

@Treece-Burgess

Copy link
Copy Markdown
Contributor

Pull Request Description

A user would encounter the following if running make under src/examples:

PAPI_state.c:46:4: warning: implicit declaration of function ‘printstate’; did you mean ‘initstate’? [-Wimplicit-function-declaration]
   46 |    printstate(status);
      |    ^~~~~~~~~~
      |    initstate
PAPI_set_domain.c: In function ‘main’:
PAPI_set_domain.c:78:4: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
   78 |    close(fd);
      |    ^~~~~
      |    pclose
locks_pthreads.c:39:4: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
   39 |    usleep(SLEEP_VALUE);
      |    ^~~~~~

Furthermore, a user would encounter errors/incorrect behavior with the following tests:

  1. PAPI_get_opt.c - the EventSet was not bound to a component before calling PAPI_set_opt( ... )
  2. multiplex.c - the EventSet was not bound to a component before calling PAPI_set_multiplex( ... )
  3. PAPI_reset.c - did not properly show an EventSet's counter values being reset as the perf_event component resets counter values upon the call to PAPI_start

All of the above is resolved in this PR.

Testing

Testing was done on Godzilla at Oregon (Intel Xeon Gold E5-2680 v4) and from testing the aforementioned compilation warnings are resolved and the updated examples run successfully.

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 requested a review from dbarry9 June 3, 2026 17:09
@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 Jun 3, 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