We are using the Java MP proto interface in order to have access to indicator constraints. The solve phase of our problems typically take several hours to run given the high number of binary variables.
The proto interface utilizes a MPModelRequest which contains the Model and SolverType and is then passed to the static method MPSolver.solveWithProto(mpModelRequest).
The number of threads cannot be specified for the request and the solveWithProto method is static, so we would like to know if instantiating an MPSolver and setting the number of threads would actually have the desired effect.
Original code : 1 thread
final MPModelRequest mpModelRequest = MPModelRequest.newBuilder()
.setEnableInternalSolverOutput(true)
.setSolverType(MPModelRequest.SolverType.SCIP_MIXED_INTEGER_PROGRAMMING)
.setModel(model)
.build();
MPSolutionResponse response = MPSolver.solveWithProto(mpModelRequest);
Creating an MPSolver : will it make use of multiple threads even though the method is static?
MPSolver mpSolver = MPSolver.createSolver(MPModelRequest.SolverType.SCIP_MIXED_INTEGER_PROGRAMMING.toString());
mpSolver.setNumThreads(8);
MPSolutionResponse response = mpSolver.solveWithProto(mpModelRequest);