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

Call to solver : trial for simplification #2452

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

guilpier-code
Copy link
Contributor

@guilpier-code guilpier-code commented Oct 4, 2024

This PR follows PR #2450 (that removes direct call to Sirius and forces Sirius behind ortools).
This is a trial for simplifications of code calling the optimization weekly solver call (mainly in opt_appel_solveur_lineaire.cpp)

What was done :

  • Correlate solver destruction (delete) with setting solver to null
    (to keep in mind : deleting a nullptr is harmless)
  • what else ?

To be done :

  • in ORTOOLS_Simplexe(...), instead of updating Probleme->ExistenceDUneSolution and use it in , we could use solver (type MPSolver) returned status.

CAUTION :

Remove changes on CI yaml files !

@guilpier-code guilpier-code changed the title Call to solver : trial forsimplification Call to solver : trial for simplification Oct 4, 2024
@guilpier-code guilpier-code changed the base branch from develop to feature/remove-sirius-direct-call October 4, 2024 15:23
@pull-request-size pull-request-size bot added size/M and removed size/L labels Oct 4, 2024
@guilpier-code guilpier-code force-pushed the fix/call-to-solver-simplified branch from b18141c to c8d5896 Compare October 4, 2024 17:14
@a-zakir
Copy link
Contributor

a-zakir commented Oct 7, 2024

  • Correlate solver destruction (delete) with setting solver to null
    (to keep in mind : deleting a nullptr is harmless)

    • what else ?

i'd say building unique_ptr from MPSolverFactory so we don't have to call ORTOOLS_LibererProbleme.
if resource release is important you could use std::unique_ptr<T,Deleter>::release

@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 7, 2024
@@ -212,26 +196,15 @@ static SimplexResult OPT_TryToCallSimplex(const OptimizationOptions& options,
ProblemeAResoudre->ExistenceDUneSolution = Probleme.ExistenceDUneSolution;
if (ProblemeAResoudre->ExistenceDUneSolution != OUI_SPX && PremierPassage)
{
if (ProblemeAResoudre->ExistenceDUneSolution != SPX_ERREUR_INTERNE)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We used to test ExistenceDUneSolution != SPX_ERREUR_INTERNE.
But ExistenceDUneSolution == SPX_ERREUR_INTERNE is impossible : indeed, ExistenceDUneSolution is given by ortools now, which does not know value SPX_ERREUR_INTERNE.

…een MPSolver and PROBLEME_SIMPLEXE_NOMME, possibly useless
Copy link

sonarqubecloud bot commented Oct 7, 2024

…tus transfers between MPSolver and PROBLEME_SIMPLEXE_NOMME, possibly useless"
@guilpier-code guilpier-code marked this pull request as ready for review October 10, 2024 09:00
Base automatically changed from feature/remove-sirius-direct-call to develop November 28, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants