[mpich-discuss] Sending Dynamically Allocated Data

Duro, Joao j.a.duro at cranfield.ac.uk
Mon Apr 26 11:53:08 CDT 2010


1) I am currently using MPICH1.2

2) You are correct!
I missed the fact that recvcount indicates the number of items received from each process, not the sum of the numbers of items received from all processes.
It does not give segmentation fault anymore.

Thanks,
Joao

________________________________________
De: mpich-discuss-bounces at mcs.anl.gov [mpich-discuss-bounces at mcs.anl.gov] Em Nome De Dave Goodell [goodell at mcs.anl.gov]
Enviado: segunda-feira, 26 de Abril de 2010 17:43
Para: mpich-discuss at mcs.anl.gov
Assunto: Re: [mpich-discuss] Sending Dynamically Allocated Data

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

_______________________________________________
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