Efficient and discrete gradient synchronization