First ValGrind didn't find anything but then the solution was found in Valgrind FAQ 4.6 (--tool=exp-ptrcheck)
Thx for the help Jed Brown wrote: > Try with valgrind. The compiler is probably initializing a variable only > at -O0. > >> On May 16, 2011 8:28 AM, "Clemens Domanig" <clemens.domanig at uibk.ac.at >> <mailto:clemens.domanig at uibk.ac.at>> wrote: >> >> Hi everyone, >> >> maybe someone can explain to me what is going wrong with my code. >> >> In my programm I read values from a vector A and write them at new >> positions into a vector B. This works well as long as I don't use any >> optimization-flags when compiling the code. If I use -O1/2/3 the petsc >> tells me: "out of range error" at VecSetValue. >> It always happens at the some position although I'm doing this kind of >> operations at different places again. >> >> petsc-version 3.1.6 >> g++-version: gcc version 4.1.2 20080704 (Red Hat 4.1.2-48) >> >> Thx for your help - C. Domanig >
