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

Refactor parsing of command line arguments and environment variables #5221

Merged
merged 7 commits into from
Jul 18, 2022

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Jul 14, 2022

  • Enforce same rule everywhere to parse booleans
    case insensitive (1,yes,true) -> true
    case insensitive (0,no,false) -> false
    otherwise call Kokkos::abort()
  • Changes in behavior
    --kokkos-disable-warnings=false would yield disable_warnings=true and now actually means false
    KOKKOS_DISABLE_WARNINGS=ON would yield disable_warnings=true but now is not recognized and causes abnormal termination of the program
    --kokkos-num-devices=3 --num-devices=4 would yield num_devices=3 and now give num_devices=4

@crtrott
Copy link
Member

crtrott commented Jul 14, 2022

Yeah abort.

@dalg24 dalg24 force-pushed the refactor_int_and_bool_env_var_parsing branch from a3d93d8 to a0574f4 Compare July 15, 2022 00:10
@dalg24 dalg24 marked this pull request as ready for review July 15, 2022 10:38
@dalg24 dalg24 added this to the Tentative 3.7 Release milestone Jul 15, 2022
@@ -176,6 +176,10 @@ unsigned get_process_id() {
#endif
}

bool is_valid_num_threads(int x) { return x > 0; }

bool is_valid_device_id(int x) { return x >= 0; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there also be a check here against the upper limit of valid device ids?

Copy link
Member Author

Choose a reason for hiding this comment

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

The limit is the sky

core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
Improve error message

Co-authored-by: Dong Hun Lee <59181952+ldh4@users.noreply.github.com>
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
Co-authored-by: Dong Hun Lee <59181952+ldh4@users.noreply.github.com>
@crtrott crtrott merged commit 2640cf7 into kokkos:develop Jul 18, 2022
@dalg24 dalg24 deleted the refactor_int_and_bool_env_var_parsing branch July 18, 2022 11:48
ndellingwood added a commit to trilinos/Trilinos that referenced this pull request Jul 22, 2022
ndellingwood added a commit to trilinos/Trilinos that referenced this pull request Aug 5, 2022
ndellingwood added a commit to trilinos/Trilinos that referenced this pull request Aug 12, 2022
ndellingwood added a commit to trilinos/Trilinos that referenced this pull request Aug 30, 2022
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.

None yet

4 participants