On Mon, 14 Apr 2003, Sherif Abd El-Momen wrote:
> I am trying to create a dynamic buffer for the data I will
> communicate. I want to communicate a struct. so I used MPI_Type_struct.
> what I am trying to do is to make each elemant to be an array where the
> size of the array is dynamic. but the process which tries to send the
> message recive a error signal. here is the error message. please advise
> me with what I am doing wrong, or of a better way to do the dynamic
> buffer.
You have 2 minor problems with this program:
1. You're making the datatype with a pointer to the pointer to the actual
datatypes. If you want to build the datatypes in this way in C++, you can
pass references to the subroutine, and then take addresses of those.
2. You should pass a count of 1 to the MPI_Isend and MPI_Recv calls,
because you're passing one instance of the data represented by the
datatype.
I've attached a new copy, look for the comments with "JMS" (my initials)
for what I changed.
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|