Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iterative_solve ... did not match C++ signature #32

Open
schreibe opened this issue Feb 17, 2015 · 17 comments
Open

iterative_solve ... did not match C++ signature #32

schreibe opened this issue Feb 17, 2015 · 17 comments

Comments

@schreibe
Copy link

Hi,
I'm trying out pyviennacl, it sounds great so far. I can run some test code, so the setup seems to be ok. (Py 2.7 on 64bit Windows 7).

But when I try pyviennacl.linalg.solve() I'm getting an error where I'm stuck. Here's the code:

import numpy as n
import pyviennacl as p

Amat = n.random.rand(20,20).astype(n.float32)
Bvec = n.random.rand(20).astype(n.float32)

pvA = p.Matrix(Amat)
pvB = p.Vector(Bvec)

mysolvertag = p.linalg.cg_tag()

mysolvertag = p.linalg.gmres_tag()
result = p.linalg.solve(pvA, pvB, mysolvertag)

print(result)

And here's the beginning of the error message:

Traceback (most recent call last):

File "", line 1, in
runfile('<path_removed>/pvcltest.py', wdir='<path_removed>')

File "C:\ANACONDA\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 580, in runfile
execfile(filename, namespace)

File "<path_removed>/pvcltest.py", line 19, in
result = p.linalg.solve(pvA, pvB, mysolvertag)

File "C:\ANACONDA\lib\site-packages\pyviennacl\linalg.py", line 474, in solve
return result_type(tag.vcl_solve_call(A.vcl_leaf, B.vcl_leaf, tag.vcl_tag),

File "C:\ANACONDA\lib\site-packages\pyviennacl\linalg.py", line 177, in vcl_solve_call
return _v.iterative_solve(*args)

ArgumentError: Python argument types in
pyviennacl._viennacl.iterative_solve(matrix_row_float, vector_float, gmres_tag)
did not match C++ signature:
iterative_solve(class viennacl::hyb_matrix<double,1> {lvalue}, class viennacl::vector<double,1> {lvalue}, class viennacl::linalg::gmres_tag {lvalue})

Is there some (stupid...) mistake in my code snippet, or is there a problem with pyviennacl?

Thanks,
sven

@schreibe
Copy link
Author

sorry for the bad formatting of the previous comment, apparently markups and hashtags are treated specially here... -sven

@tsmithe
Copy link
Collaborator

tsmithe commented Feb 17, 2015

No, that looks like a bug, though not one I've seen before. How did you install PyViennaCL?

@schreibe
Copy link
Author

Am 17.02.2015 um 14:37 schrieb Toby Smithe:

No, that looks like a bug, though not one I've seen before. How did you
install PyViennaCL?


Reply to this email directly or view it on GitHub
#32 (comment).

I think I just ran the installer for Windows
(pyviennacl_1.0.3.win-amd64-py2.7.exe).

("I think" because I'm experimenting on different systems and cannot
rule out 100% that I mixed things up. But as I said, it does run in
principle with other simple example code.)

Thanks for looking into this,
Sven

@schreibe
Copy link
Author

schreibe commented Mar 9, 2015

I have now tried the same code also on a different machine with Debian testing (so the packaged version there is 1.0.2 I think) and I get the same error message. So it doesn't seem to be Windows-specific.
thanks,
sven

@tsmithe
Copy link
Collaborator

tsmithe commented Mar 9, 2015

Hi Sven,

really sorry I haven't got round to sorting this yet. I will try and do so this week.

Best,

Toby

@elsdrium
Copy link

Hi,
I also get the same error with latest version of pyopencl on github. However, it works after changing to Upper tag.

@schreibe
Copy link
Author

schreibe commented Oct 7, 2015

Hello again, and thanks to elsdrm for the hint which I've read just now.
Trying the various options systematically yields:

  • cg_tag, gmres_tag, bicgstab_tag all produce the same error;
  • upper_tag, unit_upper_tag, lower_tag, unit_lower_tag all seem to work.

Would there be any problem with just using the working options? What I mean is, what are the features or advantages that we are missing because the first three are not working?

thanks,
sven

@karlrupp
Copy link
Collaborator

karlrupp commented Oct 8, 2015

@schreibe: The first three are for iterative solvers, while the latter four are for dense triangular solvers. I'm not sure whether @tsmithe fully completed support for sparse matrices and iterative solvers yet - hopefully he will comment.

@schreibe
Copy link
Author

schreibe commented Oct 8, 2015

Am 08.10.2015 um 10:23 schrieb Karl Rupp:

@schreibe https://github.com/schreibe: The first three are for
iterative solvers, while the latter four are for dense triangular
solvers. I'm not sure whether @tsmithe https://github.com/tsmithe
fully completed support for sparse matrices and iterative solvers yet -
hopefully he will comment.

Ok, but if "upper" and "lower" also serve to describe the input matrix
(wasn't sure about this), then of course using them would be just wrong
for a general non-triangular system matrix.

According to the help on
http://viennacl.sourceforge.net/pyviennacl/doc/examples/iterative-solvers.html:
"PyViennaCL provides iterative solvers for sparse and dense linear systems."

thanks,
sven

@kvarun95
Copy link

i am having the same problem... is it fixed??

@tsmithe
Copy link
Collaborator

tsmithe commented Apr 11, 2016

Hello again all. Alas it is not yet fixed. I expect to remain very busy with my studies until August, at which point I will dedicate some time to bringing PyViennaCL up to date. Please continue to report issues / otherwise complain in any way, if you wish! I am sorry that I do not bring better news.

@kvarun95
Copy link

thank you for your reply. could you suggest an alternative workaround? @schreibe , i would like to know what method you have used finally...

@schreibe
Copy link
Author

Am 11.04.2016 um 16:38 schrieb kvarun95:

thank you for your reply. could you suggest an alternative workaround?
@schreibe https://github.com/schreibe , i would like to know what
method you have used finally...

None. I was testing different tools and haven't used pyviennacl anymore
(so far), sorry.

cheers,
sven

@kvarun95
Copy link

The solver (iterative, with gmres tag) worked for me when I used float64 instead of float32.

@kvarun95
Copy link

going through util.py was insightful. I used the CompressedMatrix format as in util.py

@schreibe
Copy link
Author

Am 12.04.2016 um 04:31 schrieb kvarun95:

The solver (iterative, with gmres tag) worked for me when I used float64
instead of float32.

Interesting! I would have thought that I had tried variations like that
as well, but it's too long ago, I don't really remember anymore.

thanks,
sven

@schreibe
Copy link
Author

Am 12.04.2016 um 04:31 schrieb kvarun95:

The solver (iterative, with gmres tag) worked for me when I used float64
instead of float32.

Well it doesn't work for me. I guess it could also depend on whether the
hardware and driver combination supports double precision.

thanks,
sven

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants