LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Pak, Anne O (anne.o.pak_at_[hidden])
Date: 2003-06-26 14:49:43


hello:

i use malloc to allocate memory for variable that i use to store data that i
eventually send out to other nodes using MPI_Send.

if i don't call free at the end, my program works fine, but if i do, (even
if i call it after i complete MPI_Send), i get
 MPI process rank 0 (n26, p22769) caught a SIGSEGV.

for example:

double *temp;

temp = (double *)malloc(3*sizeof(double));
for (i=0;i<3;i++)
        temp[i]=i;

MPI_Send(temp,3,MPI_DOUBLE,1,tag,comm);

free(temp);

is there a trick to this? do i need to call MPI_Barrier or something?

thanks,
Anne

___________________________________________________
Anne Pak, L1-50
Building 153 2G8
1111 Lockheed Martin Way
Sunnyvale, CA 94089
(408) 742-4369 (W)
(408) 742-4697 (F)