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
I'm having a little of trouble trying to use Pandana with multiprocessing
Description of the bug
When I call net.shortest_paths (with an 's') in a multiprocessing process (I use a multiprocessing.Pool object), it doesn't finish like an infinite loop (no error message).
I tested to do the same with net.shortest_path (without an 's') and it worked! However I have to use shortest_paths because it is faster in my case.
I wanted to know if there is an explanation to this.
Network data (optional)
OpenStreetMap Data
Environment
Mac OS 11.2.1
Python 3.9.7
Pandana 0.6.1
Paste the code that reproduces the issue here:
from multiprocessing import Pool
n_cores = 3
def f(n_repet):
return [net.shortest_paths([node_0_id], [node_1_id]) for i in tqdm(range(n_repet))]
p = Pool(n_cores)
a = p.map(f, [10 for i in range(10)])
Thanks for your help!
The text was updated successfully, but these errors were encountered:
lilianmarey
changed the title
net.shortest_paths doesn't work in multiprocessing threads
net.shortest_paths doesn't work with multiprocessing
Apr 27, 2022
Hi,
I'm having a little of trouble trying to use Pandana with multiprocessing
Description of the bug
When I call net.shortest_paths (with an 's') in a multiprocessing process (I use a multiprocessing.Pool object), it doesn't finish like an infinite loop (no error message).
I tested to do the same with net.shortest_path (without an 's') and it worked! However I have to use shortest_paths because it is faster in my case.
I wanted to know if there is an explanation to this.
Network data (optional)
OpenStreetMap Data
Environment
Mac OS 11.2.1
Python 3.9.7
Pandana 0.6.1
Paste the code that reproduces the issue here:
from multiprocessing import Pool
n_cores = 3
def f(n_repet):
return [net.shortest_paths([node_0_id], [node_1_id]) for i in tqdm(range(n_repet))]
p = Pool(n_cores)
a = p.map(f, [10 for i in range(10)])
Thanks for your help!
The text was updated successfully, but these errors were encountered: