[petsc-users] Leaking Memory From the Future????

Ali Berk Kahraman aliberkkahraman at yahoo.com
Thu Mar 8 05:10:17 CST 2018


Dear All,

I have found the error. There is a general for loop around Functions 1 
and 2. So the Function 2 from the previous loop is actually causing this.

My apologies for a very very simple mistake and a stupid question. After 
trying to solve it for an entire day, I guess my senses just got closed 
and I thought silly stuff.

Best Regards

Ali


On 08-03-2018 00:13, Ali Berk Kahraman wrote:
> Dear All,
>
> I am in an impossible position. My real code is long, so I will 
> briefly describe my situation.
>
> I call 2 functions that I have written in my code, it goes like
>
> Function1(Do stuff with MatGetValues and MatSetValues);
> Visualize the Result of Function1 with MatView;
> Function2(Do stuff with MatGetValues and MatSetValues);
>
> The result I get in this situation is wrong, because I know the 
> correct result. Function 1 reaches rows of the matrix that it should 
> not. But here is where it gets interesting. If I do not call Function2 
> at all, namely do the following,
>
> Function1(Do stuff with MatGetValues and MatSetValues);
> Visualize the Result of Function1 with MatView;
> /* Function2(Do stuff with MatGetValues and MatSetValues); */
>
> Here, the result I see from Function 1 is correct and different from 
> the result of the first case. But, for my simulation to work, I must 
> call Function2. I have been dealing with this for the whole day, and I 
> still have no idea how this happens. The code sees the next line and 
> changes the result of the previous line.
>
> Any ideas? Anything similar to this in the literature?
>
> Best Regards to All,
>
> Ali Berk Kahraman
> M.Sc. Student, Bogazici Uni.
> Istanbul, Turkey
>
>
>
>
>



More information about the petsc-users mailing list