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

Update all_native_events.c to allow users to optionally disable Cuda native events #278

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Treece-Burgess
Copy link
Contributor

@Treece-Burgess Treece-Burgess commented Nov 11, 2024

Pull Request Description

This PR looks to add an optional flag to all_native_events.c titled --disable-cuda-events with options of yes and no (the default is no). The reason for this is due to the runtime length of all_native_events.c when the Cuda component has been compiled in.

Along with the --disable-cuda-events option, I have also added -h and --help. Example of --help and -h is below:

This is the all_native_events program.
For all components compiled in, it attempts to: add the component events, start, and stop.
Usage: ./all_native_events [options]
General command options:
	-h, --help                           Print the help message.
	--disable-cuda-events=<yes,no>       Optionally disable processing the Cuda native events. Default is no.

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 the enhancement New feature or request label Nov 11, 2024
/* parse command line flags */
for (i = 0; i < argc; i++) {
if (strncmp(argv[i], "--disable-cuda-events=", 22) == 0) {
strcpy(disableCudaEvts, argv[i] + 22);
Copy link
Contributor

@adanalis adanalis Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use: strncpy(disableCudaEvts, argv[i] + 22, PAPI_MIN_STR_LEN);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated all_native_events.c to use strncpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants