continue updating bgd allreduce code