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

Metadata Declaration in Core #3729

Merged
merged 1 commit into from
Feb 2, 2021

Conversation

DavidPoliakoff
Copy link
Contributor

Currently looking for a review of this mechanism for declaring and printing metadata making sure that a code change like this wouldn't perturb anything, it needs more work. A sample output after the change, if you call print_configuration

Kokkos Version: 3.3.0
Compiler:
KOKKOS_COMPILER_GNU: 830
Architecture:
Default Device: N6Kokkos6SerialE
KOKKOS_ENABLE_ISA_KNC: no
KOKKOS_ENABLE_ISA_POWERPCLE: no
KOKKOS_ENABLE_ISA_X86_64: no
Atomics:
KOKKOS_ENABLE_GNU_ATOMICS: no
KOKKOS_ENABLE_INTEL_ATOMICS: no
KOKKOS_ENABLE_WINDOWS_ATOMICS: no

@DavidPoliakoff
Copy link
Contributor Author

Confirming that this can play nicely with the Tools infrastructure. So from my side, this is what I need

@DavidPoliakoff DavidPoliakoff changed the title WIP: Metadata Declaration in Core Metadata Declaration in Core Jan 15, 2021
@DavidPoliakoff DavidPoliakoff marked this pull request as ready for review January 15, 2021 20:19
@DavidPoliakoff
Copy link
Contributor Author

Retest this please

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

I would prefer if you tackled the recording the git commit hash in a separate PR

cmake/kokkos_tribits.cmake Outdated Show resolved Hide resolved
cmake/KokkosCore_config.h.in Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/unit_test/CMakeLists.txt Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Show resolved Hide resolved
@DavidPoliakoff
Copy link
Contributor Author

@masterleinad @dalg24 I think I've addressed the comments. I deferred the Git SHA stuff for a future PR, and almost everything else I just implemented as suggested. The only exception is that I'm not adding the machinery to print MSVC, as we didn't used to print that in our print_configuration machinery

cmake/KokkosCore_config.h.in Outdated Show resolved Hide resolved
Comment on lines +147 to +149
void declare_configuration_metadata(const std::string& category,
const std::string& key,
const std::string& value);
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need the declaration in Kokkos_Core.hpp? Where else than Kokkos_Core.cpp would we use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be used in backends, the CUDA backend will likely declare configuration metadata as well

core/unit_test/CMakeLists.txt Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Show resolved Hide resolved
#else
declare_configuration_metadata("options", "KOKKOS_ENABLE_MPI", "no");
#endif
declare_configuration_metadata("architecture", "Default Device",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this part of "architecture"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is part of architecture because that's where it printed in print_configuration before. We can change that, but the underlying goal in this PR was to not shake up the printing as it happened before

@DavidPoliakoff
Copy link
Contributor Author

@dalg24, remaining are questions about making the default device part of the architecture (which it was before, but which I'm not opposed to changing), and whether we want to expose the declare_configuration_metadata symbol for use in other places

@DavidPoliakoff
Copy link
Contributor Author

Retest this please

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

Add the comment and remove the unused code.

Also I am curious whether you considered generating the tedious bit

#ifdef KOKKOS_ENABLE_FOO
declare_configuration_metadata("options", "KOKKOS_ENABLE_FOO", "yes");
#else
declare_configuration_metadata("options", "KOKKOS_ENABLE_FOO", "no");
#endif

with CMake. (NOT asking you to change)

core/src/impl/Kokkos_Core.cpp Outdated Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Show resolved Hide resolved
core/src/impl/Kokkos_Core.cpp Show resolved Hide resolved
@DavidPoliakoff
Copy link
Contributor Author

@dalg24, I copied that tedious bit from our previous implementation. That implementation doesn't look good to me, but every time we change something to "something that's exactly the same" I find out that we broke something somehow

@DavidPoliakoff
Copy link
Contributor Author

@dalg24, believe I have addressed the comments

Copy link
Member

@dalg24 dalg24 left a comment

Choose a reason for hiding this comment

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

(Need to clean up history)

@DavidPoliakoff
Copy link
Contributor Author

@dalg24: done

@dalg24 dalg24 merged commit 11f76ca into kokkos:develop Feb 2, 2021
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