eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.44k stars 1.38k forks source link

Inquiry about Parallel Simulation in SUMO with NSGA-II #15106

Closed adexoxo13 closed 3 weeks ago

adexoxo13 commented 3 weeks ago

Dear Sumo-user,

I am writing to inquire about the possibility of performing parallel simulations within SUMO for traffic light optimization.

I am currently working with the NSGA-II algorithm using a population size of 100 and 50 generations. My simulation involves a large scenario with 18,000 vehicles and 19 traffic intersections. Unfortunately, I am encountering significant computational limitations. Running the simulation for a single individual takes several hours on my current hardware configuration, making it challenging to obtain results in a timely manner, especially when limited to a single CPU core.

Therefore, I am interested in exploring the possibility of running the simulations in parallel on a server with 256 cores. This would allow me to evaluate all chromosomes simultaneously, significantly reducing the overall computation time.

I would appreciate any insights or guidance you could offer regarding parallel simulation capabilities within SUMO for my specific use case with NSGA-II.

Thank you for your time and assistance.

Sincerely, Aden

SUMO-version: latest version operating system: Linux

namdre commented 3 weeks ago

Speeding up a single simulation by running it on multiple cores is not feasible for most instances (unless your simulation is heavy on routing). Running multiple simulations (chromosomes?) in parallel should be doable. One tool for running instances in parallel is described here: https://sumo.dlr.de/docs/Tools/Misc.html#runseedspy If each chromosome could get a different .sumocfg file then you could make use of the tool to run them all in parallel.

There may also be ways to speed up your runs without parallelization. Several hours sounds too much for the scenario you are describing.

JamesPsh commented 3 weeks ago

@adexoxo13 I used Ray to run multiple SUMO simulations in parallel for a genetic algorithm. Ray supports distributed computing and significantly reduced simulation time. Consider using Ray for your task.

adexoxo13 commented 2 weeks ago

Speeding up a single simulation by running it on multiple cores is not feasible for most instances (unless your simulation is heavy on routing). Running multiple simulations (chromosomes?) in parallel should be doable. One tool for running instances in parallel is described here: https://sumo.dlr.de/docs/Tools/Misc.html#runseedspy If each chromosome could get a different .sumocfg file then you could make use of the tool to run them all in parallel.

There may also be ways to speed up your runs without parallelization. Several hours sounds too much for the scenario you are describing.

@namdre,

Thank you again for your incredibly helpful email! Your confirmation about using separate .sumocfg files for parallel execution was exactly what I needed, and I'm glad to see it's already improving my training efficiency.

I wasn't previously aware of the specific tool you linked for parallel simulations (https://sumo.dlr.de/docs/index.html). Thanks for bringing it to my attention!

Thanks again for your insightful suggestions and support. It's been invaluable!

Best regards