I'm not sure whether MPI_Datatype will allow a vector, or whether it has to be a primitive type. You could always copy your vector elements into a dynamically-allocated array and send and receive that. Remember to delete the temporary buffer afterwards.