check in allreduce tcp, check if there could be more concise form