Newsgroups: comp.parallel.mpi
From: ericb@cc.gatech.edu (Eric A. Brittain)
Subject: Dynamic Array Problem
Organization: Georgia Institute of Technology
Date: 5 Mar 1995 17:50:29 -0500
Message-ID: <3jdf7l$2eu@gvu1.cc.gatech.edu>


Hi,


I am trying to trouble getting a MPI program to past a 
dynamically allocated array of Short Integers between two processors...

Suppose the data to be passed on one processor looks like this:

CFVAL   DVAL    TVAL
11      7       3 
10      6       2 
3       3       7 
17      1       1 
3       7       3 
3       7       3 
24      8       0 
9       5       5 


By the time it gets to the other processor it looks like this:

FVAL    DVAL    TVAL
11      9999    3
10      6       9999
3       3       7
9999    1       1
3       9999    3
3       7       9999
24      8       0
9999    5       5

Note: 9999 was the initialized value.

It seems as though those values were not touch.  The first output
(above) was printed before the following send command:

MPI_Send(sendBuffer,24,MPI_SHORT_INT, 0 /*master*/,0,MPI_COMM_WORLD);

The second output was printed after the following receive command:

MPI_Recv(recBuffer,24,MPI_SHORT_INT, MPI_ANY_SOURCE,MPI_ANY_TAG, 
         MPI_COMM_WORLD,&status).

Also, MPI_Get_count(&status,....) shows that 24 elements were transferred.
Any help?  Could packing the elements make a different?


