Possible Duplicate:
Are std::vector elements guaranteed to be contiguous?
I have come across a technique in which people use a vector in C++ to receive or send data for MPI operations as it is said to store elements contiguously in memory.
However, I remain skeptical of whether this approach would remain robust for a vector of any size, especially when the vector grows to a certain size, where this assumption could break down.
Below is an example of what I am talking about :
MPI_Recv( &partials[0] , partials.size() , mpi_partial , 0,
DALG_ELIMINATE_REQ_MSG ,MPI_COMM_WORLD , &status );