You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree that we should make this consistent.
The global ordinate in Tpetra is however signed as some negative values are used as error codes.
So it should be the same signed_global_dof_index across the board.
That's ok for the internal interfaces, but I think for the external uses, we want to use what deal.II has always used: unsigned integers for quantities that can only be zero or positive.
Ah okay yes, so to return m() for example it should be unsigned.
Which is fine since the nonegative signed integers are a subset of the unsigned integers for each specific bitlength.
But we should possibly add an Assert that m internally is nonnegative and throw a TrilinosException otherwise?
Perhaps. I'm not overly concerned about that in the current case that it could happen.
In general, if Trilinos returns errors as negative numbers, we need to capture the error and pass it on via the usual deal.II mechanisms (via Assert or AssertThrow). If Trilinos returns error via exceptions, then I think we can just do an implicit conversion between the integer types and assume that Trilinos will just never return a negative value. That's because returning a negative value would be a bug in Trilinos (unless they specifically say that that's how they deal with errors) and we do not have to guard every call to Trilinos for possible bugs.
As mentioned in #16670, different parts of the Tpetra wrappers define their own
size_type
types, and some of these are signed:It is perhaps not the best design to have these types be all over the place. We might want to make this more uniform before the next release.
@jpthiele @kinnewig
The text was updated successfully, but these errors were encountered: