LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Nihar Sanghvi (nsanghvi_at_[hidden])
Date: 2004-03-31 14:04:12


Hi,

Check the return value of malloc for any errors. Also check the value of
'j' for *zero*. Make sure it does not have a value beyond the memory
allocated.

Thanks,

On Wed, 31 Mar 2004, Vishal Sahay wrote:

>Nihar --
>
>I think this can be because of two things --
>- malloc failed in some way
>- he freed his allocated memory somewhere or assigned it to NULL
>
>Any other thoughts?
>
>-Vishal
>
>
>On Wed, 31 Mar 2004 Llfrg_at_[hidden] wrote:
>
># Hi,
>#
># I need to dynamically allocate a MPI_Request array. I declare the pointer as folows:
>#
># MPI_Request *request;
>#
># next, I malloc memory:
>#
># request = (MPI_Request *)malloc((size-1)*sizeof(MPI_Request));
>#
># but when I call:
>#
># MPI_Isend(&sbuf[i],1,MPI_INT,i,124,MPI_COMM_WORLD,request+j);
>#
># wth j=0, I get a segmentation fault. Does anyone know what's wrong?
>#
># Thanks,
># Leonardo.
># _______________________________________________
># This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>#
>_______________________________________________
>This list is archived at http://www.lam-mpi.org/MailArchives/lam/
>

Powered by LAM/MPI...
---------------------------------------
Nihar Sanghvi
LAM/MPI Team
Graduate Student (Indiana University)
http://www.lam-mpi.org
--------------------------------------