mattwigway / OSRM.jl

MIT License
2 stars 0 forks source link

Parallel distance_matrix #6

Open mattwigway opened 1 year ago

mattwigway commented 1 year ago

OSRM's distance matrix is not parallelized. This makes sense for something running as a server handling many requests (parallelize between rather than within requests), but a common use case for OSRM.jl will be to start OSRM and run one huge distance matrix.

We can parallelize on the Julia side by running distance_matrix multiple times for different sets of origins and pasting it all back together afterwards.

mattwigway commented 1 year ago

Project-OSRM/osrm-backend#6629 is something to keep in mind here - distances may be calculated differently when the overall set of coordinates is changed, because OSRM seems to require all coordinates to be snapped to the same strong component. At a minimum, we should make sure that the same result comes out every time when run with the same number of threads, but it may be possible to make it consistent regardless of threading by including all points in the coordinates array, and just telling OSRM to use different subsets for origins and destinations.