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

parallel processing in Gurobi

回答済み

コメント

4件のコメント

  • Riley Clement
    • Gurobi Staff

    Hi Seyed,

    In test1 the subproblems are running sequentially because of #pragma omp critical, and the solves are not competing for resources.  The total time required will be at least the sum of these runtimes, so 48s+.

    In test2 your subproblems are running in parallel, but they are competing for resources, so each subproblem solves slower.  However the total time required for test2 will be closer to 16s, so overall it is faster and I would not say it is performing poorly.

    I think the difference can be explained by the resource sharing.  You have set Threads=1 for your subproblem but threads are not the only shared resource.  How big are the subproblems in terms of rows/columns/nonzeros?

    - Riley

    0
  • Seyed Khademnia
    • Gurobi-versary
    • First Question
    • First Comment

    It is about 400 rows of constraints and about 3000 variables.
    About the performance, since the machine has more than needed actual cores for this test, what do you think is the resource that is limiting the performance? Would it be rational to think the bottleneck is the communication between RAM and CPU? If so, is there any method to reduce the size of the Gurobi solver since it is going to only solve LP problems, and Gurobi has an arsenal of tools for MILP, which are not needed in my case?

    Thank you for your response.


    Best

    0
  • Riley Clement
    • Gurobi Staff

    what do you think is the resource that is limiting the performance? Would it be rational to think the bottleneck is the communication between RAM and CPU?

    Yes I think so - L3 cache and memory bandwidth would be the main culprits I think.  Perhaps i/o if writing to file.  I would not be surprised if there are other shared resources I am not aware of.

    is there any method to reduce the size of the Gurobi solver since it is going to only solve LP problems, and Gurobi has an arsenal of tools for MILP, which are not needed in my case?

    It does this automatically.  If you are solving LPs then Gurobi is not going to be setting up a Branch and Bound tree, running heuristics etc.  It's only going to call routines which are relevant for LPs.

    As an aside, if you're not already experimenting with the Method parameter for your subproblems then I certainly would.  With one thread the default LP algorithm will be dual simplex.  You may want to try primal simplex too.  I'd be careful about using barrier, if you subproblem is found to be infeasible or unbounded during barrier (before crossover) then the Farkas dual or unbounded ray won't be available.

    - Riley

     

    0
  • Seyed Khademnia
    • Gurobi-versary
    • First Question
    • First Comment

    Thanks! I will check out the methods parameter. 

    One thing I figured out here is that the .reset() method is not necessary for changing the objective and reoptimizing the model, so I removed it. Now the same test as above returns the solutions in about 8 seconds. There must be some serialization factor that occurs in .reset(), which I can now avoid and achieve better performance. 

    Best

    0

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