MPI_Alltoallw is the generalized all-to-all communication collective that allows user-defined datatypes for each element in the input arrays.