-
Notifications
You must be signed in to change notification settings - Fork 707
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
CMake: Use deal.II's global index type in Tpetra compatibility test #13973
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the only valid Tpetra types seem to be
int
(akaint32_t
) andlong long
(akaint64_t
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure I undestand. Ar you saying using an unsigned type here doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, using an
unsigned
type here doesn't work because Tpetra switched toint
(aka signedint32_t
) orlong
(aka signedint64_t
) as global ordinal (the latter is the default). According to the Tpetra documentation using an unsigned integer is strongly discouraged. Trying it out anyway will lead to (a) either the build system telling you during configure that you cannot use an unsigned integer, and if you work around that, (b) a compile time error with a static assertion in Kokkos.So the bottom line is that we cannot use Tpetra with
using GO = unsigned int
from Trilinos version 13.2 onwards. We will have to create a compatibility layer to cast between signed and unsigned integer type and make sure to always use the signedint32_t
orint64_t
types instead ofuint32_t
, oruint64_t
that we use internally.So bottom line is that this check will always fail for Trilinos 13.2 onwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, 13.2 works fine with
GO = unsigned int
. I get a warning a configure time but it compiles fine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried for about 10 hours to beat the Gentoo package [1] into shape with no success:
This was a compilation with the following modification:
But the real issue here is that this isn't really a good solution. For two reasons:
GO
set tounsigned int
with good conscience for Debian and Ubuntu. This would be highly surprising for users and contrary to the intention of the upstream Trilinos authors.So it looks like that the only meaningful course of action at some point will be to simply support the default
int64_t
ordinal that Tpetra is using - for example by making 64bits the default in deal.II and providing a good translation betweenuint64_t
andint64_t
when needed.[1] https://github.com/gentoo/gentoo/blob/master/sci-libs/trilinos/trilinos-13.4.0-r3.ebuild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several packages depends on KokkosKernels so it might not be Tpetra itself that creates the problem but another package. I agree that we need to get away from using unsigned integers. It will not be supported in the future anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is, do we need (or want) to do something for the release now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of checking all places where we use Tpetra?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will have to fix this after the release.
In particular, I tried to compile deal.II with a signed
int64_t
yesterday. This wasn't particularly successful and there is a lot of work to clean this up.So what about we actually merge this pull request that will ensure that Tpetra is available with a compatible type - even though it will likely imply that it doesn't get enabled for most users.