plaans / aries

Toolbox for automated planning and combinatorial solving.
MIT License
39 stars 5 forks source link

How to make the serial run of scheduler excutation deterministic? #128

Closed John-HW-Cao closed 5 months ago

John-HW-Cao commented 5 months ago

I tried to solver certain JSP by using target/release/scheduler for multiple times, like examples/scheduling/instances/jobshop/ta53.jsp .

the solving progress log and the solving time it takes varies dramatically, sometimes it even fails to obtain the optimal solution. The two following runs are examples. could anyone help me with that? I used the v0.3.3 tag.

====== SAT ===== DB size : 2460 Num unit propagations: 5878689 ... # propagations: 39102528 # domain updates: 247101742 TOTAL RUNTIME: 226.917505

====== SAT ===== DB size : 1369 Num unit propagations: 400289 ... # propagations: 3538542 # domain updates: 44017785 ... TOTAL RUNTIME: 33.155073

John-HW-Cao commented 5 months ago

when I did not specific the number of parallel threads, I noticed that there are two processes running. ./scheduler -t 300 jobshop ../../examples/scheduling/instances/jobshop/ta53.jsp

So is it possible that it actually solved the problem in parallel? and the undeterminstic property comes from the default parallel scheme?

arbimo commented 5 months ago

Indeed we do not guarantee determinism of the solver, even when it runs in a single threaded mode (default for scheduler). There is no explicit randomization but it is often the case that some data-structure or algorithms depend on runtime parameters (e.g. allocated addresses) which make the output slightly different across runs.

Even though those are typically very minor changes, on challenging problems they can have a butterfly effect, pushing the search in a branch that is much harder to close.

It would be interesting to pin and remove these sources of non-determinism but it is not something I expect to have the bandwidth to do myself any time soon.

John-HW-Cao commented 5 months ago

Thank you for your response ~