You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although we have a multi threaded parsing process we still have static edge and node IDs. Of course, if the OSM source change the IDs will change but still "static per file" which is an important property for many scenarios. We are testing this already in the RoutingAlgorithmIT but I wasn't 100% sure how this can be achieved as the integration was done long ago by @NopMap. Now I wanted to clarify this and here are my findings confirming this:
there is a PbfStreamSplitter extracting raw data of every PBF blob (PbfBlobResult), but does so in sequence
the splitter creates new PbfBlobResult per area to a queue preserving the order: LinkedList<PbfBlobResult>. And if there are too many blobs the splitter will block. (Here the blocking is done manually, done in the copied copy from the external public domain library osmosis)
then every blob itself is sent in a chunk to the sink, i.e. OSMInputFile but only if the PbfBlobResult is complete, which ensures preserving the order.
another queue in OSMInputFile (LinkedBlockingQueue<OSMElement>) is used to return single OSMElements to the OSMReader. A blocking queue is used to avoid that the parsing code can flood the graph construction.
Based on your description, I don't understand why GH use multi-thread. It seems a single thread procedure.
And I want to confirm, do you mean for the exact same osm.pbf file, no matter when we run the GH, the internal edge ID is exact the same? Actually, I think the whole graph is exactly same.
The procedure is multi-threaded with multiple worker threads, seperating I/O operations from data processing and doing the processing of multiple chunks of data in parallel. Much faster than doing everything in a single thread, but does not scale indefinitely.
You think the bottleneck is the I/O, so you use multi-thread to read data chunk from disk. CPU is much faster than I/O, so you use single thread to process the OSMElement. Am I right?
And I want to confirm, do you mean for the exact same osm.pbf file, no matter when we run the GH, the internal edge ID is exact the same? Actually, I think the whole graph is exactly same.
yes
CPU is much faster than I/O, so you use single thread to process the OSMElement. Am I right?
not only because CPU is faster but also because the import is simpler and we don't need synchs
Yes. Exactly. I we use single thread, no need to synch, and whole thing will be simpler.
Like I can rebuild data, which kept the order.
Thank you very much!
Hmmh, I think 'if there are too many blobs the splitter will block' is not correct. At least I cannot see this blocking, which might be the reason of #916
Activity
zhiqiangZHAO commentedon Nov 2, 2015
Hi Peter,
Based on your description, I don't understand why GH use multi-thread. It seems a single thread procedure.
And I want to confirm, do you mean for the exact same osm.pbf file, no matter when we run the GH, the internal edge ID is exact the same? Actually, I think the whole graph is exactly same.
NopMap commentedon Nov 2, 2015
The procedure is multi-threaded with multiple worker threads, seperating I/O operations from data processing and doing the processing of multiple chunks of data in parallel. Much faster than doing everything in a single thread, but does not scale indefinitely.
zhiqiangZHAO commentedon Nov 2, 2015
You think the bottleneck is the I/O, so you use multi-thread to read data chunk from disk. CPU is much faster than I/O, so you use single thread to process the OSMElement. Am I right?
karussell commentedon Nov 3, 2015
yes
not only because CPU is faster but also because the import is simpler and we don't need synchs
zhiqiangZHAO commentedon Nov 4, 2015
Hi Peter,
Yes. Exactly. I we use single thread, no need to synch, and whole thing will be simpler.
Like I can rebuild data, which kept the order.
Thank you very much!
karussell commentedon Jan 13, 2017
Hmmh, I think 'if there are too many blobs the splitter will block' is not correct. At least I cannot see this blocking, which might be the reason of #916