Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Parallel processing

Hello, blocks until the started process has completed. This makes it unsuitable for starting sumo from a TraCI script. Instead subprocess.Popen or traci.start() should be used (take a look at the sourcecode of the start() method in sumo/tools/traci/

If you intend to use multiple traci connections from a single script then you must use traci.start() with a label to access the connections later.
You can also do
traci.start([...], label="a")
conn1 = traci._connections["a"]
traci.start([...], label="b")
conn2 = traci._connections["b"]


2017-10-03 3:12 GMT+02:00 Luke Kakadukl <koseninc8@xxxxxxxxx>:

I'm using Sumo with Traci in Python. 
I want to run multiple simulation in parallel.
I did find out that this is possible with:["sumo", "-c", "sim1.sumocfg", "--remote-port", "8813"])
 conn1 = traci.connect(8813)["sumo", "-c", "sim2.sumocfg", "--remote-port", "8814"])
 conn2 = traci.connect(8814)
 conn1.simulationStep() # run 1 step for sim1
 conn2.simulationStep() # run 1 step for sim2
When I call  simulation hangs at connecting. I did try to use several different port number but the result was the same. 
I'm using Windows machine and I also tried to run simulations with Firewall turned off, but this did not help.

Does someone know what could be the problem here?
I'm using latest SUMO nightly build.

Another question:
Is running every simulation in separate process with traci.start([...])  a correct way to do? 
[label is not specified, default value is used] 
By process I mean Process object from multiprocessing library.

Kind regards,

sumo-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top