Memory corruption error in SNESSolve

2008-01-23 Thread Dave May
Hey Vijay, I can spot something wrong. VecGetSize gives you the global length of the vector. However VecGetArray only gives you access to the LOCAL portion of the vector data for that processor. Thus you need to use a local index if you are going to set the values directly into the array. In p

Memory corruption error in SNESSolve

2008-01-22 Thread Matthew Knepley
Dave is correct. Also I would point out that based upon your example code, you probably want to use FormFunctionLocal() instead. For this, please refer to SNES ex5. Thanks, Matt On Jan 22, 2008 6:55 PM, Dave May wrote: > Hey Vijay, > I can spot something wrong. VecGetSize gives you t

Memory corruption error in SNESSolve

2008-01-22 Thread Vijay M
Well thanks for the reply Matt. I currently do not have valgrind installed in the server i am running my code and will not have access to the person who can for couple of days. I guess what you are saying makes sense and the problem could still be in my function. I did check for it again and could

Memory corruption error in SNESSolve

2008-01-22 Thread Matthew Knepley
On Jan 22, 2008 3:54 PM, Vijay M wrote: > Hi all, > > I am currently trying to use LibMesh with PETSc SNES solver to solve a > nonlinear Diffusion-reaction problem. The code works fine with 1 > processor but when i use 2 processors for the exact same problem, it > throws me this error regarding me

Memory corruption error in SNESSolve

2008-01-22 Thread Vijay M
Hi all, I am currently trying to use LibMesh with PETSc SNES solver to solve a nonlinear Diffusion-reaction problem. The code works fine with 1 processor but when i use 2 processors for the exact same problem, it throws me this error regarding memory corruption. I am not sure what this error is ab