Hi,
I'm fairly new to or-tools, and trying to use it to solve some of our project problems these days. My question is as follows. I used CP-SAT solver (Python API) to solve a job scheduling problem with single thread. With some simple data as input, it takes roughly 18 seconds (wall time) to find the optimal solution. This experiment is repeated 10 times and the used wall time is quite stable, that is around 18 seconds in each run.
Then I changed the solver parameter, set solver.parameters.num_search_workers = 4. This will enable 4 threads during a search according to my current understanding. With the same input data as above and running this experiement 10 times, however, gives me some unexpected performance results. The used wall time varies quite a bit in these 10 runs. The fastest run uses about 16 seconds and the slowest run uses roughly 21 seconds. This also means that some run with multi-thread enabled actually performs worse than single threaded case above.
According to the release notes of July 2018, it says: Parallel search: Use the SatParameters.num_search_workers option to
enable multiple threads during a search. Each thread can
have different parameters, and different random seeds. This maximizes diversity, and
the probability that at least one thread will find solutions.
Thus, my question is whether multi-thread is just to maximize the probability for at least one thread to find solution to the problem. Could multi-thread speed-up the search procedure? In addition, I have only used or-tools for some weeks, so I'm not sure if the above setting of the parameter num_search_workers is the only thing I need to add to enable the full capability of multi-threading. Am I missing something?
Basically, I just used some simple data as input to the above job scheduling problem. The actual amount of input data is much larger. I tried to run it in single thread once and it can only find FEASIBLE solution after one hour. Then I come up with the idea to use parallel search in the hope that it could speed-up the search. But my current experiment seems not to be very promising. Could anybody please provide some insights about this issue? Thanks in advance!
Best regards,
Gerry