[mpich-discuss] Sending Dynamically Allocated Data

Dave Goodell goodell at mcs.anl.gov
Mon Apr 26 11:43:50 CDT 2010


Based on your backtrace, I don't think that you are using MPICH2.

However, with that said, I think I see the problem.  You pass  
"(npart*size)" as the value for recvcount, but this should be "npart"  
instead.  The MPI standard says that this value is the "number of  
elements received from any process".

-Dave

On Apr 26, 2010, at 11:05 AM, Duro, Joao wrote:

> Hi there,
>
> I am trying to send a dynamically allocated structure using  
> MPI_Allgather().
> My objective is to gather all the population in the master node and  
> then distribute it to all other processes.
>
> All the code is here:
> http://codepad.org/URczlAEl
>
> I am getting segmentation from memcpy() called by MPI_Allgather().
> I am probably doing something wrong regarding sending dynamic  
> allocated data.
> Could someone have a look?!
>
> Regards,
> Joao
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list