1

I'm following the steps here in order to use all my computing power (10-core Intel i9 CPU) and solve a one-instance abstract Pyomo model. However, it seems that the solver is just using one CPU core and it takes more than 2 days to return a solution for a 50-node input (with 10 nodes it just takes seconds.) any help about making Pyomo model run in all available CPU cores?

Thanks

ascub
  • 95
  • 1
  • 11
  • 1
    Which solver? Compiled how? Called how? What do you expect in terms of gains? (i would not expect more than a speedup of 2 or something like that; but of course this depends on many details) – sascha Mar 16 '18 at 16:36
  • 1
    Depends on the solver and the model. Some solvers are single threaded others operate in parallel. Typically, MIP models can benefit a lot from parallel processing. LPs not as much (some interior point methods do a reasonable job). Beware that you need a ton of memory to allow the solver to run the model in parallel on many cores. – Erwin Kalvelagen Mar 16 '18 at 17:01
  • 1
    In addition to @sascha's questions, can you tell us something about the current timing? How long is spent generating the Pyomo model? How much time is spent in the solver? If Pyomo is taking forever, it could be due to a relatively easy-to-fix problem with how you are declaring your constraints. Also, what kind of model (LP/MIP/NLP/MINLP? stochastic?)? – jsiirola Mar 16 '18 at 21:26
  • I'm dealing with a MILP model and using GLPK. The model is created nearly instantly and the solver call part is as follows `opt = SolverFactory('glpk') instance = model.create_instance("scenario1.dat") results = opt.solve(instance, tee=True) instance.solutions.load_from(results)` As of what to expect, the model is still running (for more than 2 days now) and my CPU usage is below 20% and this is just a few cores, so I just want to know if it is currently being processed in parallel or if there is margin to improve its runtime. – ascub Mar 17 '18 at 17:25
  • 1
    GLPK is a serial solver (i.e. single threaded). You may try CBC or a commercial solver like Cplex or Gurobi. These solvers have parallel capabilities. – Erwin Kalvelagen Mar 17 '18 at 19:09

2 Answers2

0

Thanks to @Erwin Kalvelagen for pointing out GLPK's serial nature, after doing some experiments I migrated to Gurobi and now all my 10 CPU cores are being used by the Pyomo model.

ascub
  • 95
  • 1
  • 11
-1

This may just be a syntax error on your end. Try using Arduino for C++. I9 processors do not support other ones like the Five.9 servers. Beware, overrides may occur to burn out your i9.