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

Changing the count parameter type from int to size_t in reduction algorithms. #380

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

piotrchmiel
Copy link

  1. Int means that user cannot pass an array size larger than numeric_limits::max
  2. Signed type deosn't make sense regarding the size of the array, which cannot be less than 0.
  3. In many places under the hood, count is converted to size_t anyway, e.g. malloc
  4. gloo/gloo/allreduce.h uses size_t as number of elements which is inconsistent with other reduction algorithms
  5. ReductionFunction takes size_t as count parameter
  6. While experimenting with examples, I ran into a problem with the number of elements being limited by int. It took me a while to figure out why the code wasn't working. Other users may also encounter this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants