-
Notifications
You must be signed in to change notification settings - Fork 27
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
Use spral in Julia #127
Comments
@amontoison could you advise? |
Hi @yuwenchen95! For using SPRAL in Julia, I started a SPRAL.jl package with all wrappers generated by Clang.jl. |
Hi @amontoison I tried to use the wrapper in your repo
but still get the error
It seems that I may have some type errors for input parameters of the function |
@yuwenchen95 |
I updated Spral.jl. using Spral
options = Spral.spral_ssids_options()
inform = Spral.spral_ssids_inform()
Spral.spral_ssids_default_options(options)
check = Cint(true)
posdef = Cint(false)
n = 5
ptr = [1, 3, 6, 8, 9, 10]
row = [1, 2, 2, 3, 5, 3, 4, 4, 5]
val = [2.0, 1.0, 4.0, 1.0, 1.0, 3.0, 2.0, -1.0, 2.0]
akeep = [Ptr{Ptr{Cvoid}}()]
fkeep = [Ptr{Ptr{Cvoid}}()]
order = Cint[]
Spral.spral_ssids_analyse(check, n, order, ptr, row, Cdouble[], akeep, options, inform) |
Thanks for the update! Now I can get the error information as in the native C, where it returns the error
I'm very confused since I am using the example from https://www.numerical.rl.ac.uk/spral/doc/v2016.09.23/C/ssids.html#c.spral_ssids_analyse. Did you happen to have this issue before? |
Do you have the same error if you run the C example directly. |
@amontoison I have no idea as I did not write the documentation. |
The example in the documentation is just a reference to the actual example file, so it should always be the relevant, up-to-date version: Line 764 in 58f8a4a
However, it looks like it does not automatically update on the website, since it does not have the fix 21c41f73. That's what causes the out-of-range error when using that code there. Other changes like 40e6c78f are also not there. Is there some script that has to be run to refresh the documentation for the website? Or did some script break that is supposed to update the documentation on push? |
Well spotted @mjacobse, I think the issue is that the documentation is HTML that is built using Sphinx from the *.rst sources and it has not been rebuilt for 7 years. Part of the issue is that the Fortran docs use the poorly maintained Sphinx extension https://github.com/VACUMM/sphinx-fortran so we are not even sure if the docs will build without error. I will have a go at rebuilding the Sphinx documentation and seeing if it is still possible to build it at all. |
@yuwenchen95 @mjacobse I have rebuilt updated documentation for v2023.08.02, please see here: |
Thanks for the updated documentation @jfowkes @mjacobse , it works for @amontoison Shall we also import data struct |
In Julia, you just need to define akeep = [Ptr{Ptr{Cvoid}}()]
fkeep = [Ptr{Ptr{Cvoid}}()] The pointers to the Fortran structures ( We could create a new structure that is more friendly for the users like: mutable struct SsidsSolver
akeep::...
fkeep::...
control::...
inform::...
end and add high-level Julia functions that call the wrappers under the hood. |
I asked it because when I run
it returns an error that
I'm not so sure whether my use of Menwhile, I'm confused by the returned error above as it looks like a CPU related error while we have already set Line 45 in 7e44d5a
|
@yuwenchen95 before using SSIDS you need to:
otherwise you get OMP cancellation errors as above. Unfortunately the only way to enable this is via setting environment variables, see #124. @amontoison we should add this to the Julia docs. |
Jari, should we move the Julia interface |
Thanks! I then got another error for calling
Is it due to improper access for |
@yuwenchen95 |
Sure. Here is the code I transfered from the documentation, https://www.numerical.rl.ac.uk/spral/doc/latest/C/ssids.html#c.spral_ssids_factor
It collapses when calling |
I am trying to use the SPRAL's SSIDS GPU direct solver in Julia. When I was running
I got the following error
Anyone has a clue to solve it?
Btw, is there any better way to use SPRAL like HSL in Julia, instead of the SPRAL_jll?
The text was updated successfully, but these errors were encountered: