gloo
gloo copied to clipboard
Changing the count parameter type from int to size_t in reduction algorithms.
- Int means that user cannot pass an array size larger than numeric_limits
::max - Signed type deosn't make sense regarding the size of the array, which cannot be less than 0.
- In many places under the hood, count is converted to size_t anyway, e.g. malloc
- gloo/gloo/allreduce.h uses size_t as number of elements which is inconsistent with other reduction algorithms
- ReductionFunction<T> takes size_t as count parameter
- 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.