gloo icon indicating copy to clipboard operation
gloo copied to clipboard

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

Open piotrchmiel opened this issue 1 year ago • 0 comments

  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<T> 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.

piotrchmiel avatar Jan 22 '24 20:01 piotrchmiel