メインコンテンツへスキップ

Solver Runtime

回答済み

コメント

3件のコメント

  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Tyler,

    According to Pyomo's documentation you can use the \(\texttt{get_model_attr("RunTime")}\) method.

    Best regards, 
    Jaromił

    0
  • Tyler Jaffe
    • Gurobi-versary
    • First Comment
    • First Question

    Hi Jaromil,

    Thank you for getting back to me. I looked into this, but the operation you posted can only be used if you use the Gurobi persistent solver. The command does not work for the shell solver. Also, when I use the persistent solver vs just the shell solve I get noticeably different results. The solver time goes up by 50% when you use the persistent one. is there a command similar to this for when using just the shell solver? I know this adds another question, but why would the persistent solver require more time, if the model is the same. 

     

    Thank you,

    Tyler

    0
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Tyler,

    For the shell solver, you should be able to directly use Gurobi methods unless there is another Pyomo layer on top of the Gurobi shell. In your case it would be the getAttr() method.

    The solver time goes up by 50% when you use the persistent one. is there a command similar to this for when using just the shell solver? I know this adds another question, but why would the persistent solver require more time, if the model is the same.

    It is often the case that 3rd party software manipulates the model a bit under the hood, e.g., they add constraints and/or variables in a different order. This can already be enough to affect the solver's performance. Thus, we recommend to use Gurobi's Python API. It is very intuitive and it shouldn't be hard to switch to Gurobi's native Python API if you have been working with Pyomo before.

    Best regards, 
    Jaromił

    0

サインインしてコメントを残してください。