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)
|