change the length for allreduce