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

[HSL_MC66] Add a Julia interface #121

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amontoison
Copy link
Member

@amontoison amontoison commented Oct 6, 2022

The generic build script was able to compile HSL_MC66 and HSL_MI35 without any error.

@amontoison
Copy link
Member Author

@dpo
Copy link
Member

dpo commented Oct 6, 2022

Hold on. We don't yet have interfaces to those, right? We should add a version together with the interface.

@amontoison
Copy link
Member Author

amontoison commented Oct 6, 2022

I discovered that:

  • HSL_MC66 requires KB07, MC64, HLS_MC64, HSL_MC68 and MC77.
  • HSL_MI35 requires KB07, MC61, HSL_MC64, HSL_MC68 and MC77.

I can't interface them without the dependencies.

@amontoison
Copy link
Member Author

amontoison commented Oct 6, 2022

Oh, the content of the dependencies is already in the src folder. The copy/paste all relevant functions in sdeps90.f90 and ddeps90.f90.

@amontoison amontoison changed the title Update versions.jl Add a Julia interface for HSL_MC66 Oct 6, 2022
@dpo
Copy link
Member

dpo commented Oct 6, 2022

Oh, the content of the dependencies is already in the src folder. The copy/paste all relevant functions in sdeps90.f90 and ddeps90.f90.

Yes. We have to decide if we will interface the dependencies or not (to not have them duplicated).

Also, let's please add one at a time.

@amontoison
Copy link
Member Author

@JSOBot runtests

@amontoison
Copy link
Member Author

https://github.com/JuliaSmoothOptimizers/HSL.jl/actions/runs/3230766215/jobs/5289581640#step:6:101

@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (4bc3cc0) 0.53% compared to head (87c4c94) 0.52%.

Additional details and impacted files
@@           Coverage Diff            @@
##            main    #121      +/-   ##
========================================
- Coverage   0.53%   0.52%   -0.02%     
========================================
  Files         11      12       +1     
  Lines       1488    1524      +36     
========================================
  Hits           8       8              
- Misses      1480    1516      +36     
Impacted Files Coverage Δ
src/HSL.jl 100.00% <ø> (ø)
src/hsl_mc66.jl 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@amontoison
Copy link
Member Author

We cited this ordering in the GPMR paper for information :).

src/hsl_mc66.jl Show resolved Hide resolved
src/mc21.jl Outdated
function mc21ad(n, icn, licn, ip, lenr, iperm, numnz, iw)
ccall((:mc21ad_, libmc21),
Nothing,
Cvoid,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's put this in a separate pr

@dpo
Copy link
Member

dpo commented Oct 12, 2022

Could you please also add a paragraph and an example in the docs each time you add an interface?

@amontoison
Copy link
Member Author

Yes, but can I do a few interfaces before I update the documentation?
I prefer to do PRs only dedicated to documentation. It will avoid some git rebase and give me the time to find a trick for #102...
You will also merge faster the interfaces like this.

@dpo
Copy link
Member

dpo commented Oct 13, 2022

I'm thinking minimal documentation so we don't forget. We know how essential is it to users. One paragraph + 1 example is enough.

@amontoison amontoison changed the title Add a Julia interface for HSL_MC66 [HSL_MC66] Add a Julia interface Oct 14, 2022
@dpo
Copy link
Member

dpo commented Oct 17, 2022

Needs to be rebased. The source files should be available now.

@amontoison
Copy link
Member Author

@JSOBot runtests

@JSOBot
Copy link

JSOBot commented Oct 17, 2022

Testing HSL tests passed: https://gist.github.com/6d4c924998108f089c299991e944e1a0

@dpo
Copy link
Member

dpo commented Nov 4, 2022

@amontoison What is the status here? Should this be rebased?

@amontoison amontoison force-pushed the mc66 branch 2 times, most recently from 6e09e00 to cea2f01 Compare November 4, 2022 17:07
@amontoison
Copy link
Member Author

@amontoison What is the status here? Should this be rebased?

The interface is finished and I rebased the PR.

src/hsl_mc66.jl Outdated
lp = Ref{Int32}(6)
wp = Ref{Int32}(6)
context = Ptr{Cvoid}()
ccall((:__hsl_mc66_single_MOD_monet_print_message, libhsl_mc66),
Copy link
Member Author

@amontoison amontoison Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a segmentation fault with this ccall (Linux CI builds).
Maybe the mangling is different... It's the first time that I wrap a routine from a Fortran submodule.

src/hsl_mc66.jl Outdated
rowdiff = Ref{Float64}()
kblocks = Ref{Cint}()
mc66d(m, n, nz, irn, jcn, nblocks, control, seed, row_order, info, rowptr, column_order, colptr, netcut, rowdiff, kblocks)
mc66d_print_message(info[], control)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just pass info here?

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

Successfully merging this pull request may close these issues.

3 participants