Setting number of cores in PDLP #4563
-
|
Hi all, Thanks a lot for the magnificent work in developing the latest version of PDLP. On the latest paper that you have uploaded on arxiv regarding PDLP, you mention that the new method supports multithreading. I have tried to look in the documentation and the forum to see if there is any way that I can set the preferred number of threads for PDLP. However, I could not find something except some parameter setting for the CP_SAT solver. Therefore, could you provide a minimal example on how to set the number of cores used by PDLP (specifically for python and C++)? Thanks in advance and keep up the excellent work, --Constantinos |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
That probably depends on A: what interface and B: what version you are using. Using the math-opt interface it should work like any other solver parameters.proto edit Above proto-message also has an PDLP-specific param-field and there is even a python-example using it to set threds: https://github.com/google/or-tools/blob/v9.12/ortools/pdlp/samples/simple_pdlp_program.py#L62 params = solvers_pb2.PrimalDualHybridGradientParams()
# Below are some common parameters to modify. Here, we just re-assign the
# defaults.
optimality_criteria = params.termination_criteria.simple_optimality_criteria
optimality_criteria.eps_optimal_relative = 1.0e-6
optimality_criteria.eps_optimal_absolute = 1.0e-6
params.termination_criteria.time_sec_limit = np.inf
params.num_threads = 1Using the low-level interface (i don't think many people use it), i used the following in the past: PrimalDualHybridGradientParams params;
params.set_num_threads(2);
auto solution = PrimalDualHybridGradient(qp, params);I mentioned the version as there are some heavy changes to math-opt happening for quite some time now. |
Beta Was this translation helpful? Give feedback.
-
|
I see what you are saying. After performing a few experiments since yesterday, I can see that pdlp on multicore is still quite slow even for LP instances of a million non-zeros or so. I guess all these enthusiastic reactions have to do only with the GPU-based version of this code. |
Beta Was this translation helpful? Give feedback.
Parameter Options: PrimalDualHybridGradientParams
->