DistMat can work with non-empty output directory