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

Using HSL_jll instead of custom compile #263

Merged
merged 7 commits into from
Jun 13, 2023
Merged

Using HSL_jll instead of custom compile #263

merged 7 commits into from
Jun 13, 2023

Conversation

sshin23
Copy link
Member

@sshin23 sshin23 commented Jun 7, 2023

This PR updates MadNLPHSL.jl to use HSL_jll instead of the custom-compiled library

@sshin23 sshin23 requested a review from frapac June 7, 2023 19:13
@sshin23 sshin23 linked an issue Jun 8, 2023 that may be closed by this pull request
@sshin23
Copy link
Member Author

sshin23 commented Jun 8, 2023

locally confirmed that HSL works on windows

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2023

Codecov Report

Merging #263 (19ec6ad) into master (55c5cd9) will increase coverage by 1.10%.
The diff coverage is 55.55%.

❗ Current head 19ec6ad differs from pull request most recent head a75ac39. Consider uploading reports for the commit a75ac39 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #263      +/-   ##
==========================================
+ Coverage   75.41%   76.51%   +1.10%     
==========================================
  Files          40       40              
  Lines        4128     3811     -317     
==========================================
- Hits         3113     2916     -197     
+ Misses       1015      895     -120     
Impacted Files Coverage Δ
lib/MadNLPHSL/src/MadNLPHSL.jl 16.66% <0.00%> (-74.25%) ⬇️
lib/MadNLPHSL/src/ma27.jl 85.29% <ø> (+1.23%) ⬆️
lib/MadNLPHSL/src/ma57.jl 85.07% <ø> (+1.25%) ⬆️
lib/MadNLPHSL/src/ma77.jl 96.05% <100.00%> (-0.25%) ⬇️
lib/MadNLPHSL/src/ma86.jl 94.73% <100.00%> (ø)
lib/MadNLPHSL/src/ma97.jl 94.44% <100.00%> (ø)

... and 29 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@frapac
Copy link
Member

frapac commented Jun 8, 2023

That looks good to me, it's good to see that HSL_jll is simplifying code a lot.

Before merging this, I think it would be nice to run a benchmark, just to check the compilation flags are set properly in HSL_jll and we are not introducing any performance regression.

@sshin23
Copy link
Member Author

sshin23 commented Jun 8, 2023

@frapac Thanks for the quick review!

Regarding the potential performance regression, I'd say we don't need to worry too much as the user can custom compile HSL_jll if they want to compile with specific compilation flags. Then, they can link it with Julia using Overrides.jl via the Dummy HSL_jll package https://juliahub.com/ui/Packages/HSL_jll/BQ0xV/1.0.0+0

cc @amontoison

ma86_set_num_threads(opt.ma86_num_threads)

# Note: the current version of HSL_jll does not support openmp.
# this will be reenabled once openmp is supported in HSL_jll.
Copy link
Member

Choose a reason for hiding this comment

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

OpenMP is not supported?!
Did I do a mistake when I compiled HSL_jll.jl?

Copy link
Member

@amontoison amontoison Jun 9, 2023

Choose a reason for hiding this comment

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

@sshin23 I fixed the issue upstream.
I linked the shared library with -fopenmp but I didn't compiled with -fopenmp...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the quick action @amontoison! Indeed we used to have -fopenmp flag in our previous compilation script

isvalid(`$FC -fopenmp -fPIC -c -O3 -o $name.o $name$ext`)

If you want to check it before releasing it, I'd be happy to test it with MadNLPHSL

Copy link
Member

@amontoison amontoison Jun 9, 2023

Choose a reason for hiding this comment

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

What is your platform with libgfortran?

Base.BinaryPlatforms.host_triplet()

Copy link
Member Author

Choose a reason for hiding this comment

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

x86_64-linux-gnu-libgfortran5-cxx11-libstdcxx30-julia_version+1.9.1

@amontoison
Copy link
Member

amontoison commented Jun 8, 2023

For information, the file build_tarballs.jl will be available tomorrow to regenerate an HSL_jll.jl from JuliaHSL.
It will be uploaded on the web page of JuliaHSL.

@amontoison
Copy link
Member

@sshin23
For the version of HSL_jll.jl precompiled with LBT, you need to load at least one BLAS / LAPACK backend.
We do that automatically in HSL.jl and Ipopt.jl:
https://github.com/JuliaSmoothOptimizers/HSL.jl/blob/main/src/HSL.jl#L16-L23

import LinearAlgebra, OpenBLAS32_jll

function __init__()
if VERSION ≥ v"1.7"
Copy link
Member

Choose a reason for hiding this comment

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

It's if VERSION ≥ v"1.9"
I need to fix it in HSL.jl.

@sshin23 sshin23 merged commit f0effa2 into master Jun 13, 2023
@frapac frapac deleted the ss/HSL_jll branch April 10, 2024 12:24
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.

Unable to install HSL extension in Windows
4 participants