Fixed DFS clustering so it works with mpi