k-means: hack to do the iteration on the host