Replies: 2 comments 3 replies
-
As you suspect, CBC uses CPU time for the time limit. So, it will indeed use more or less 3600/4 seconds for each thread (more or less because for the root relaxation it uses only one thread). Maybe @tkralphs can complement the answer here. In fact, this question could be also moved / copied to the cbc github here: https://github.com/coin-or/Cbc/ |
Beta Was this translation helpful? Give feedback.
-
Thanks to @tkralphs comment, I've added the import pulp
# this counts wall-time and stops after 3600 seconds.
solver = pulp.PULP_CBC_CMD(timeLimit=3600, threads=4) You can change that to cpu time by doing the following: import pulp
# this sums the time in each cpu, so stops roughly after 3600/4 seconds, as before the change
solver = pulp.PULP_CBC_CMD(timeLimit=3600, threads=4, timeMode='cpu') |
Beta Was this translation helpful? Give feedback.
-
I have been reading through a few online discussions on GitHub and other sources (https://groups.google.com/g/pulp-or-discuss/c/IKE--kT6c5U/m/Y0OUJCqoBQAJ, https://github.com/coin-or/pulp/issues/463) about using multiple threads with CBC, but I haven’t been able to find a direct answer to my question. So I wanted to reach out to you directly about it. Does the time limit correlate to the number of threads passed in to the solver? So for instance when I set “threads=4” and “time limit=3600”, does that mean each thread gets a time limit of 3600/4 seconds? I.e. does CBC use CPU time or wall time for the time limit?
Beta Was this translation helpful? Give feedback.
All reactions