mdhaber / scipy

Scipy library main repository
http://scipy.org/scipylib/
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

FIX: CI/failure; parallel/threads options support #98

Closed mckib2 closed 1 year ago

mckib2 commented 1 year ago

Reference issue

What does this implement/fix?

Additional information

mckib2 commented 1 year ago

Here are the examples I checked with -- first is parallel=False, second is parallel=True:

>>> from scipy.optimize import linprog
>>> c = [-1, 4]
>>> A = [[-3, 1], [1, 2]]
>>> b = [6, 4]
>>> x0_bounds = (None, None)
>>> x1_bounds = (-3, None)
>>> res = linprog(c, A_ub=A, b_ub=b, bounds=[x0_bounds, x1_bounds], options={"disp": True, "presolve": False, "parallel": False, "threads": 3})
<console>:1: OptimizeWarning: Unrecognized options detected: {'parallel': False, 'threads': 3}. These will be passed to HiGHS verbatim.
Running HiGHS 1.2.0 [date: 2021-07-09, git hash: n/a]
Copyright (c) 2022 ERGO-Code under MIT licence terms
Solving LP without presolve or with basis
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0    -1.0000000000e+03 Ph1: 2(3999); Du: 1(1) 0s
          2    -2.2000000000e+01 Pr: 0(0) 0s
Model   status      : Optimal
Simplex   iterations: 2
Objective value     : -2.2000000000e+01
HiGHS run time      :          0.00

>>> res = linprog(c, A_ub=A, b_ub=b, bounds=[x0_bounds, x1_bounds], options={"disp": True, "presolve": False, "parallel": True, "threads": 3})
<console>:1: OptimizeWarning: Unrecognized options detected: {'parallel': True, 'threads': 3}. These will be passed to HiGHS verbatim.
Running HiGHS 1.2.0 [date: 2021-07-09, git hash: n/a]
Copyright (c) 2022 ERGO-Code under MIT licence terms
Solving LP without presolve or with basis
WARNING: Number of threads available = 3 < 8 = Simplex concurrency to be used: Parallel performance may be less than anticipated
Using EKK parallel dual simplex solver - PAMI with concurrency of 8
  Iteration        Objective     Infeasibilities num(sum)
          0    -1.0000000000e+03 Ph1: 2(3999); Du: 1(1) 0s
          2    -2.2000000000e+01 Pr: 0(0) 0s
Model   status      : Optimal
Simplex   iterations: 2
Objective value     : -2.2000000000e+01
HiGHS run time      :          0.00