On Jul 6, 2013, at 2:33 PM, Patrick Brückner 
<patrick.brueck...@student.uni-kassel.de> wrote:

> data p;
> p.collection = malloc(sizeof(int)*N);
> 
> printf("[%d] before receiving, data id %d at %d with direction 
> %d\n",me,p.id,p.position,p.direction);
> 
> MPI_Status data_status;
> MPI_Recv(&p,1,MPI_data,MPI_ANY_SOURCE,99,MPI_COMM_WORLD,&data_status);
> if(data_status.MPI_ERROR != MPI_SUCCESS) {
>    printf("[%d] ERROR %d",me,data_status.MPI_ERROR);
>    return -1;
> }
> printf("[%d] received status %d\n",data_status.MPI_ERROR);

I think you need "me" as the first printable argument in there.

> received++;
> printf("[%0d] received data %d (%d/%d) at position %d with direction 
> %d\n",me,p.id,received,expected,p.position,p.direction);
> --- snip ---
> 
> I get this output:
> 
> [1] before receiving, data id -1665002272 at 0 with direction 0
> [0] received status 0
> [1] received data -1665002272 (1/2) at position 0 with direction 0
> 
> I am wondering if you had any hint for me, why data is still not having the 
> correct data but just the old, uninitialized values, and why I don't get any 
> error.

My first guess would be that you created the MPI_data datatype incorrectly; 
that's what you should probably check into.

-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to