Re: How to send dynamic vector?
dopiotr wrote:
> Hello Group,
>
> int Msg[size];
> MPI_Send(Msg, size, MPI_INT, DEST, TAG, MPI_COMM_WORLD);
> this is working fine.
>
> But how to send Msg declared like this:
> int *Msg=(int*)malloc(sizeof(int)*size);
Have you included <stdlib.h>? We recommend dropping the cast, and write
this:
int *Msg = malloc(sizeof(int)*size);
> It gives me
> p4_error: interrupt SIGSEGV: 11
> not_send: could not write to fd=4, errno = 32
MPI related questions are off-topic here, try
comp.parallel.mpi
--
Tor <torust [at] online [dot] no>
"Technical skill is mastery of complexity, while creativity is mastery
of simplicity"
|