Locality-driven checkpoint and recovery