-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use gsl::index consistently #61
Comments
In the Nek drivers, I see some cases where |
Here are some suggestions based on the Core Guidelines and a look at what's happening in ENRICO: Flagging Signedness Mismatches of Container IndicesThe Core Guidelines recommend using signed indices. Likewise. the Core Guidelines assume that
Our vendor code represents a mixture of unsigned and signed data types:
The core guidelines recommend not flagging signedness mismatching due to indices. This is a good solution for us.
Narrowing Conversions for Container IndicesDeclaring indices as
In light of this, we have a couple of options. Not sure which is best, but I'm slightly in favor of the second one:
Variable Types for Container Sizes and Other SizesAgain, we've got some variability in our code:
However, I don't imagine this will result in narrowing conversions. The Nek array sizes are effectively read-only, since Nek uses static arrays. And when we're setting up the MPI comm split, we don't really use any of the other container sizes. So I think we should:
|
@paulromano and I had some Slack discussions, and I wanted to summarize here. What we settled on was:
With respect to the Nek code, this is a course-correction on my part. Previously ( #60 ), I had declared indices and sizes as
where Instead, I plan to introduce something like:
where
|
Thanks for the clarifications! This sounds good to me. |
We should be using
gsl::index
consistently throughout enrico.@RonRahaman
The text was updated successfully, but these errors were encountered: