pybnb
pybnb copied to clipboard
Multihreading instead of multiprocessing
Hi there, Will there ever be a multithreading support instead of the already implemented multiprocess version? This may be very useful if multiple nodes share a child, and the bound() function makes use of all parents infos.
Hi @DarioSimonato, sorry to get back to you so late. No, I haven't put much consideration into multi-threading support as I would expect the objective() and bound() function calls to be inherently CPU bound, which is exactly the type of multi-threaded computation that will not work well with Python (due to the GIL).
With that being said, the TSP examples highlight the use of the NestedSolver to perform additional nested branch-and-bound processing of each node received by a process. There could be some opportunity there to allow an additional level of parallelism at the local CPU-node level (presumably by setting up another MPI communicator heirarchy). However, the NestedSolver only supports serial processing at this time.