k-means working on multiple nodes: includes stencil analysis, scheduling, and object serialization