algorithms/reduce: dynamic finding of the work group size