Zero solution with cula sparse
14 posts
• Page 1 of 1
Re: Zero solution with cula sparse
If B is zero, then you have a trivial solution where x=0.
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
Re: Zero solution with cula sparse
Unfortunatelly that is indeed true. but can't i search for a solution other than this profinite one? I know there is another solution, because GELIM gives me one with the initial code.
- gregk
- Posts: 9
- Joined: Thu Apr 18, 2013 3:28 am
Re: Zero solution with cula sparse
A full-rank linear system has only a single solution. Are you certain that your gaussian elimination code is producing a correct result? I ask, because sparse gaussian is non-trivial because it will create new non-zeroes (potentially to the point of making your matrix dense).
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
Re: Zero solution with cula sparse
The gelim code is surely correct and I think i should take the same solution in the first place. Maybe i've malformed the matrix during the convertion to CSR.
I think i need to check it out again.
Thanks for the help
Btw, i am trying now to trigger a data error when the solver is called, but i can't xD
I am changing the n and nnz arguments but i still get the same output.
How can i indicate that the data i am passing are not correct?
I think i need to check it out again.
Thanks for the help
Btw, i am trying now to trigger a data error when the solver is called, but i can't xD
I am changing the n and nnz arguments but i still get the same output.
How can i indicate that the data i am passing are not correct?
- gregk
- Posts: 9
- Joined: Thu Apr 18, 2013 3:28 am
Re: Zero solution with cula sparse
You should consider calculating the residual of your gelim code to see how accurate it is: || A*x-b || should be a very small number.
But really, if your B is all zeroes then your answer should be zero.
CULA doesn't do a lot of error checking on your data unless you enable the debug option. You're hitting a short circuit path where your initial residual is calculated and then no iterations occur, because the answer can be trivially calculated.
But really, if your B is all zeroes then your answer should be zero.
CULA doesn't do a lot of error checking on your data unless you enable the debug option. You're hitting a short circuit path where your initial residual is calculated and then no iterations occur, because the answer can be trivially calculated.
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
Re: Zero solution with cula sparse
I changed solver, tweaked my code a bit and now i get a proper solution.
But i've come up with another problem. I need to call CULA inside a loop, what should i do with the initialize and the shutdown functions??? should they be inside or outside the loop?
I've seed that cula takes some time to initialize, but when i tried to put the initialize inside the loop it did that only the first time. All the next ones, i think where bypassed, with the results being garbage(maybe its the solvers fault here i am not sure, i'll test it again asap) Is this normal?
But i've come up with another problem. I need to call CULA inside a loop, what should i do with the initialize and the shutdown functions??? should they be inside or outside the loop?
I've seed that cula takes some time to initialize, but when i tried to put the initialize inside the loop it did that only the first time. All the next ones, i think where bypassed, with the results being garbage(maybe its the solvers fault here i am not sure, i'll test it again asap) Is this normal?
- gregk
- Posts: 9
- Joined: Thu Apr 18, 2013 3:28 am
Re: Zero solution with cula sparse
You'll want to initialize outside the loop.
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
Re: Zero solution with cula sparse
Our strings are ISO-8859-1 - your editor may be expecting UTF8 or some kind of wide character encoding?
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
Re: Zero solution with cula sparse
If you're solving against zeros, that's what you should expect. "0" basically means the solver terminated before even getting to the first iteration.
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
Re: Zero solution with cula sparse
IT could be that there's a bug there. The Fortran support has improved quite a bit in S5, so you might want to try that out as well. (Check cula_sparse_legacy.f90)
I'd also note that GMRES is one of our less preferred solvers, so you may also wish to try some of the others. The "solver selection flowchart" in the manual may be of assistance to you.
I'd also note that GMRES is one of our less preferred solvers, so you may also wish to try some of the others. The "solver selection flowchart" in the manual may be of assistance to you.
- john
- Administrator
- Posts: 587
- Joined: Thu Jul 23, 2009 2:31 pm
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest