Only generate MPI_Datatypes and Gatherv information when n changes