1

I am interested in leveraging more number of physical cores when solving a MIP problem with mathopt.

Parallelization was easy with CP-SAT by setting the number of search workers

solver.parameters.num_workers = 8 # use 8 cores

I struggling to find the right parameter to enable the solver to use more than 1 core to solve with mathopt. I am using HiGHS solver with mathopt (like below snippet)

params = mathopt.SolveParameters(enable_output=True)
result = mathopt.solve(model, mathopt.SolverType.HIGHS, params=params)

-- EDIT --

params = mathopt.SolveParameters(enable_output=True, threads=8)

I get below error:

    proto_result = solver.solve(

RuntimeError: INVALID_ARGUMENT: threads not supported for HiGHS solver, this must be set using globals, see HiGHS documentation

tried below:

params = mathopt.SolveParameters(enable_output=True, highs={"threads": 8})
result = mathopt.solve(model, mathopt.SolverType.HIGHS, params=params)

    result = math_opt_parameters_pb2.SolveParametersProto(

ValueError: Protocol message HighsOptionsProto has no "threads" field.

Can anybody please help ?

2 Answers 2

1

You can export to MPS as seen here:

https://github.com/google/or-tools/blob/stable/ortools/math_opt/io/python/mps_converter_test.py

For some further context, see this recent conversation on the or-tools google group:

https://groups.google.com/g/or-tools-discuss/c/x_gvQQzpisk/m/eOB8v8Q6AQAJ

AFAIK, HiGHS is only multithreaded for LP, not for MIP, so this may not do what you want (better to check with HiGHS team).

Sign up to request clarification or add additional context in comments.

Comments

1

We have memory issues with highs in parallel. This is currently disabled.

2 Comments

Many thanks Laurent. Is there a way however in mathopt to export the model as a .mps file which can then be fed to highs solver externally ? I know in pywraplp library of or tools, there was a function "ExportModelAsMpsFormat", is there something similar in mathopt ?
I do not know. I will ask the math_opt team.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.