0

I have a MIP model that I need to generate its solution pool. Generating this pool takes around 5 minutes but I need to do this pool generation for 100k model, so I need this pool to run at least 8 times faster but unfortunately I don't have any knowledge about speeding up cplex. Is there any settings that I can change in order to make it run faster?Is it possible to make it run in parallel on different CPUs? My pool settings :

    cpx = mdl.get_cplex()
    cpx.parameters.mip.tolerances.integrality.set(0)
    cpx.parameters.simplex.tolerances.markowitz.set(0.999)
    cpx.parameters.simplex.tolerances.optimality.set(1e-9)
    cpx.parameters.simplex.tolerances.feasibility.set(1e-9)
    cpx.parameters.mip.pool.intensity.set(2)
    cpx.parameters.mip.pool.absgap.set(1e75)
    cpx.parameters.mip.pool.relgap.set(1e75)
    cpx.parameters.mip.limits.populate.set(50)
Sana.Nz
  • 81
  • 11
  • When you say, "for 100k model", do you mean for 100k different model**s** or for one model that is 100k times larger (i.e., by number of variables, constraints, etc.)? – rkersh Jun 05 '20 at 17:45
  • It is one model but I want to run it for 100k times with different variables value – Sana.Nz Jun 06 '20 at 09:55
  • 1
    CPLEX will use all the available CPUs & cores by default (up to a sensible number, it doesn't usually help to use too many). So its probably already solving each model using multiple cores & threads.There is a parameter/performance tuning tool available for CPLEX that might help speed up each solve. If the models are independent, obviously you could run them in parallel on multiple machines. – TimChippingtonDerrick Jun 07 '20 at 06:24
  • What approaches in Cplex I can use to run different models in parallel? – Sana.Nz Jun 09 '20 at 11:50

1 Answers1

1

Two things come to mind:

  1. Try playing with the MIP emphasis parameter (see here). In particular, try value "4 Emphasize finding hidden feasible solutions". You can also try to crank up heuristics.
  2. If you have more than one core on your machine, then by default CPLEX will use all available cores for solving a model. Instead of throwing all the computing power at one single model you could try to solve several models in parallel, each with a reduced number of threads. For example, if you have 12 cores then you can either solve one model with 12 models or you can solve 4 models in parallel, using 3 threads for each. Depending on how well CPLEX can utilize multiple threads for your instances, the latter approach may be faster.
Daniel Junglas
  • 5,830
  • 1
  • 5
  • 22
  • So you mean if I have more cores my model will run faster? But I don't see it. I have two pc with same type of CPUs, one has 6 cores and the other has 26 cores. Their runtime for the same model is equal! I don't understand this – Sana.Nz Jun 08 '20 at 11:31
  • That is exactly what I mean: It is not guaranteed that more cores mean faster solution times. Not all models benefit from more cores. In your case it seems that models solve equally fast with 6 and with 26 threads. So there is no point in using 26 threads to solve *one* model. Instead, you can limit the solve to 6 threads (by setting CPLEX parameters) and then solve 4 models in *parallel*. So you can solve 4 models simultaneously in the same time you solved one model before. – Daniel Junglas Jun 09 '20 at 06:15
  • Ok. I understand. Thank you. Just one more thing, is there a special approach for running several models simultaneously in Cplex ? – Sana.Nz Jun 09 '20 at 11:49
  • No, sorry, this stuff has to be done outside of CPLEX. – Daniel Junglas Jun 09 '20 at 15:15