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

Support HSL solvers #113

Merged
merged 6 commits into from
Jun 18, 2024
Merged

Support HSL solvers #113

merged 6 commits into from
Jun 18, 2024

Conversation

amontoison
Copy link
Contributor

@amontoison amontoison commented Jun 18, 2024

@ocots
Copy link
Member

ocots commented Jun 18, 2024

@amontoison Are we ok that with your proposal then the user won't have to do using HSL or import HSL_jll like here: https://github.com/0Yassine0/COTS.jl/blob/main/Benchmark/GoddadModeles.ipynb

@amontoison
Copy link
Contributor Author

amontoison commented Jun 18, 2024

Yes, the users don't need to do using HSL or import HSL_jll.
We check that HSL solvers are installed or not here and try to use by default.
"mumps" is used as fallback if we can't use a linear solver.

@amontoison
Copy link
Contributor Author

@amontoison Are we ok that with your proposal then the user won't have to do using HSL or import HSL_jll like here: https://github.com/0Yassine0/COTS.jl/blob/main/Benchmark/GoddadModeles.ipynb

@ocots
You did a typo in your notebook. You used ma27 instead of ma57 for some benchmarks:

sol_ma57 = OptimalControl.solve(RocketOC,init=init,output_file="rocketOC.out",linear_solver="ma27",hsllib=HSL_jll.libhsl_path);
bOC_ma57 = @benchmark (OptimalControl.solve(RocketOC,init=init,display=false,linear_solver="ma27",hsllib=HSL_jll.libhsl_path));

@amontoison
Copy link
Contributor Author

Two tests are failing locally but I don't think that it's related to this PR:

Test: abstract OCP definition
:goddard :max_rf :abstract :constr: Test Failed at /home/alexis/Bureau/git/CTDirect.jl/test/suite/abstract_ocp.jl:83
  Expression: (sol3.objective, 1.0125, rtol = 0.01)
   Evaluated: 1.002093564754221  1.0125 (rtol=0.01)

Stacktrace:
 [1] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
 [2] macro expansion
   @ ~/Bureau/git/CTDirect.jl/test/suite/abstract_ocp.jl:83 [inlined]
 [3] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
 [4] top-level scope
   @ ~/Bureau/git/CTDirect.jl/test/suite/abstract_ocp.jl:82
Test: all constraint types
Test: discrete continuation
INFO: normalizing given time grid...
:global_variable :warm_start: Test Failed at /home/alexis/Bureau/git/CTDirect.jl/test/suite/continuation.jl:124
  Expression: (mean(iter_list), 17, rtol = 0.01)
   Evaluated: 18.0  17 (rtol=0.01)

Stacktrace:
 [1] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
 [2] macro expansion
   @ ~/Bureau/git/CTDirect.jl/test/suite/continuation.jl:124 [inlined]
 [3] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
 [4] top-level scope
   @ ~/Bureau/git/CTDirect.jl/test/suite/continuation.jl:114

@ocots
Copy link
Member

ocots commented Jun 18, 2024

Two tests are failing locally but I don't think that it's related to this PR:

Test: abstract OCP definition
:goddard :max_rf :abstract :constr: Test Failed at /home/alexis/Bureau/git/CTDirect.jl/test/suite/abstract_ocp.jl:83
  Expression: (sol3.objective, 1.0125, rtol = 0.01)
   Evaluated: 1.002093564754221  1.0125 (rtol=0.01)

Stacktrace:
 [1] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
 [2] macro expansion
   @ ~/Bureau/git/CTDirect.jl/test/suite/abstract_ocp.jl:83 [inlined]
 [3] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
 [4] top-level scope
   @ ~/Bureau/git/CTDirect.jl/test/suite/abstract_ocp.jl:82
Test: all constraint types
Test: discrete continuation
INFO: normalizing given time grid...
:global_variable :warm_start: Test Failed at /home/alexis/Bureau/git/CTDirect.jl/test/suite/continuation.jl:124
  Expression: (mean(iter_list), 17, rtol = 0.01)
   Evaluated: 18.0  17 (rtol=0.01)

Stacktrace:
 [1] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:672 [inlined]
 [2] macro expansion
   @ ~/Bureau/git/CTDirect.jl/test/suite/continuation.jl:124 [inlined]
 [3] macro expansion
   @ ~/julia/julia-1.10.4/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
 [4] top-level scope
   @ ~/Bureau/git/CTDirect.jl/test/suite/continuation.jl:114

I do not have this error...

@ocots
Copy link
Member

ocots commented Jun 18, 2024

C'est pénible, à cause de notre registre perso, j'ai l'impression que les tests passent pas. J'ai essayé d'updater les fichiers yml mais ça n'a aucun rapport. Il faudrait pas merge directement dans main mais dans une branche hsl de CTDirect.jl.

J'ai redirigé vers hsl. J'accepte puis test de merge dans main.

@ocots ocots changed the base branch from main to hsl June 18, 2024 19:02
@ocots ocots merged commit 6b1a829 into control-toolbox:hsl Jun 18, 2024
0 of 3 checks passed
@amontoison amontoison deleted the hsl branch June 18, 2024 19:12
@amontoison
Copy link
Contributor Author

amontoison commented Jun 18, 2024

Est-ce que tu as installé la version officielle de HSL_jll.jl sur ta machine?
Peut-être que ça change la solution et les tests ne passent que lorsqu'on utilise mumps.

@ocots
Copy link
Member

ocots commented Jun 18, 2024

Non j'ai rien installé. Du coup, tout se fait avec mumps. Du coup faudrait inspecter ça.

@PierreMartinon Point intéressant !

@PierreMartinon
Copy link
Member

Non j'ai rien installé. Du coup, tout se fait avec mumps. Du coup faudrait inspecter ça.

@PierreMartinon Point intéressant !

Gouzi ? J'ai rien fait moi !

Ce que je peux dire c'est que le test sur mean(iter_list) compare le nombre moyen d'iterations sur une serie de problemes (continuation discrete). Ce n'est peut-etre pas tres robuste a cause de l'arrondi donc je pourrai faire une comparaison sur des flottants au lieu d'entiers.

(note: en pleins travaux ces jours-ci, donc pas super reactif)

@amontoison amontoison mentioned this pull request Jun 21, 2024
2 tasks
@jbcaillau
Copy link
Member

Gouzi ? @ocots tu as quand même pas mergé alors que les tests passaient pas (@amontoison dis qqchose merde 🤭)

@ocots
Copy link
Member

ocots commented Jun 21, 2024

Les tests passent car on ne teste pas avec autre chose que Mumps.

@jbcaillau
Copy link
Member

Dans le notebook je vois des tests avec les solveurs HSL : ça fonctionne ou pas ? L'install est documentée qqpart ?

@ocots
Copy link
Member

ocots commented Jun 21, 2024

Oui Yassine a des résultats avec les solveurs HSL. Pour l'installation voir control-toolbox/CTBenchmarks.jl#3

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.

4 participants