# An Efficient Parallelization of Microscopic Traffic Simulation
## 3 Results
### Assessment with the Bologna Scenario  
First, we examine with the Bologna scenario how the total runtime \(T_{R}\) increases with the number of simulated time steps \(N_{S}\) (e.g., the total simulated time divided by the simulation step time \(T_{S}\)) and the demand level (e.g., the total number of simulated trips). Figure 7 shows that with a five-fold increase in the number of simulation steps \(N_{S}\) (from 172 k to 864 k) the runtime increases proportionally by a factor of 4.8 at the demand level of 25%. The higher the demand level, the more disproportionately the runtime increases. At a 100% demand level, the runtime increases 12 times when simulation steps are increased only five times. This effect could be explained by the higher number of vehicle transfers and interactions, which means more time is spent on atomic exchangers. However, more profiling is needed to identify the cause of the slowdown. Next, the performance gains of ParSim, running on the GPU, versus the original SUMO simulation, running on a single core of the CPU, are investigated. Simulations of the 24 h Bologna scenario were repeated under four levels of traffic demand (25%, 50%, 75%, and 100%). In each case, the exact same network, trips, and routes were used by the simulators and the simulation runtimes were recorded. From the runtimes in Table 5 obtained from the Bologna scenario, it is again evident that the simulation times increase with increasing traffic. However, the SUMO simulation seems to be more affected than the ParSim simulation. This may be due to difficulties for SUMO in resolving congestion within the junction. Such artificial congestion can produce queues that can invade and gridlock the entire network. In fact, the average speed of the 100% SUMO simulation decreased to below 1 m/s toward the end of the simulation. SUMO has a teleport procedure (which triggers after a 90 s vehicle standstill) that can temporarily resolve mutual blocking by moving vehicles out of the junction to the next free edge. However, this is often not sufficient and the queues at affected junctions continue to grow. In any case, the performance gains of the GPU-based simulations transcend those of SUMO by factors between 1800 and 5000. Concerning memory usage, the Bologna testbed exhibits a very compact memory footprint, increasing from only 132 MB at 25% demand to 258 MB at 50%, 404 MB at 75%, and just 503 MB at the full 100% scenario. The accuracy and reliability of the GPU-based microsimulator have been evaluated by comparing two key indicators obtained from the ParSim and the SUMO simulation: (1) the average waiting time, which is the sum of all times during which the vehicle's speed drops below 0.1 m/s--this is the way SUMO calculates the waiting time (for example in front of traffic lights)--and (2) the average speed of vehicles during their trips. The results of both indicators are summarized in Table 6 for the two simulators. The waiting times for ParSim are generally lower and the average speeds higher, especially for higher demand levels. The average travel speeds can be used to quantify the error ParSim is showing with respect to SUMO due to the simplified dynamics at intersections. When comparing these speeds in the two simulators for demand levels where SUMO does not show deadlock phenomena (e.g., the 25% and 50% scenarios), the relative error of ParSim is between 11% and 15%, respectively. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Demand Level** & **Number of Trips** & **SUMO (CPU)** & **ParSim (GPU)** & **Speed Gain** \\ \hline
25\% & 261,279 & 20,376 s & 11.00 s & 1852 \\
50\% & 522,558 & 49,356 s & 13.85 s & 3563 \\
75\% & 783,837 & 88,128 s & 24.18 s & 3644 \\
100\% & 1,045,116 & 200,916 s & 39.76 s & 5053 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Simulation runtime comparison between ParSim (on GPU) and SUMO (on CPU) for different demand levels in the Bologna scenario. Figure 7: Increase of simulation runtime \(T_{R}\) with an increasing number of iterations and demand levels in the Bologna scenario.