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

Warn users when a flag prefixed with -[-]kokkos is not recognized and do not remove it #5256

Merged
merged 6 commits into from
Jul 26, 2022

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Jul 22, 2022

  • Do not silently ignore flags we do not recognize when parsing command line arguments if they start with --kokkos or -kokkos
  • Provide a function to tell Kokkos Core not to emit a warning for flags that match some user provided regular expression Impl::do_not_warn_not_recognized_command_line_argument. By default, we only exclude those starting with --kokkos-tool but we could expand later as needed.
  • Fix bug: do not remove flags prefixed with --kokkos that were not actually handled

@dalg24 dalg24 added the Enhancement Improve existing capability; will potentially require voting label Jul 22, 2022
@dalg24
Copy link
Member Author

dalg24 commented Jul 22, 2022

PS: feel free to suggest a better name for the function

Copy link
Contributor

@lucbv lucbv left a comment

Choose a reason for hiding this comment

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

I think that's fine, I like the use of regex

@dalg24 dalg24 marked this pull request as draft July 25, 2022 16:15
@dalg24 dalg24 changed the title Warn users when a flag prefixed with -[-]kokkos is not recognized Warn users when a flag prefixed with -[-]kokkos is not recognized and do not remove it Jul 25, 2022
@dalg24 dalg24 marked this pull request as ready for review July 25, 2022 17:35
@dalg24
Copy link
Member Author

dalg24 commented Jul 26, 2022

Retest this please

if (check_arg(argv[iarg], "--kokkos-numa") ||
check_arg(argv[iarg], "--numa")) {
warn_deprecated_command_line_argument(get_flag(argv[iarg]));
// remove flag if prefixed with '--kokkos-'
remove_flag = std::string(argv[iarg]).find("--kokkos-") == 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
remove_flag = std::string(argv[iarg]).find("--kokkos-") == 0;
bool begins_with_kokkos = std::string(argv[iarg]).find("--kokkos-") == 0; // move up to top
remove_flag = begins_with_kokkos;

@dalg24 dalg24 merged commit e4c1b6a into kokkos:develop Jul 26, 2022
@dalg24 dalg24 deleted the warn_not_recognized_cla branch July 26, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants