Large-scale urban traffic simulation with Scala and high-performance computing system

https://doi.org/10.1016/j.jocs.2019.06.002Get rights and content

Highlights

  • A Scala/Akka-based large scale simulation system is presented.

  • The system is applied to the problem of urban traffic simulation.

  • The details of implementation are presented.

  • Very promising results of scalability up to 1000 cores are shown.

Abstract

High-performance computing systems make it possible to implement large-scale simulations of natural phenomena. However, in order to develop efficacious and efficient solutions, easy-to-use software platforms and applications are required. Up until now, the most popular solutions in this area were based on the message passing interface. Next, the authors successfully tackled this problem using Erlang; now, we focus on Scala/Akka — a popular and widely used standard in parallel and distributed programming. The paper focuses on the scalable implementation of a traffic simulation system in an asynchronous and notably desynchronized way. In addition to describing the concept of the system, a series of experiments on a cluster of up to 1000 nodes (24,000 cores) is presented and discussed, showing the efficiency and scalability. The main aim of the paper is to show that the implementation of high-performance computing-grade software solutions lies at the hand of any programmer proficient in Java Virtual Machine-related technologies.

Introduction

Computer simulation of natural phenomena is a widely used method that helps us understand and predict changes in a system's state over time. With the growing computational power of modern hardware, one can expect a corresponding growth in the performance and accuracy of such simulations. However, the astonishing computational power promised by contemporary high-performance computing platforms (HPC) is not straightforward due to their hardware architecture. The power is provided by the multiplication of relatively slow nodes, and the platforms are composed of thousands of independent processors. This fact creates the need for massively parallel versions of algorithms. In the case of data-intensive computations (like the simulation of natural phenomena), creating an efficient parallel implementation poses a great challenge.

The phenomenon considered in this paper is an urban traffic simulation, which has been the subject of active research since the 1950s [11]. Over the years, three different levels of details of the traffic model have been proposed: macro-, meso-, and microscopic [35]. The microscopic models, which represent the individual features of different cars and drivers, are currently dynamically researched and used in road engineering. However, the growing complexity of models, the need for simulating large environments (like whole cities) and the desire to get results immediately, make the simulation problem a complex computational challenge. One of the possible solution is to use a cluster of computers.

Despite the many attempts to create parallel traffic simulation algorithms, the problem of executing a microscopic traffic simulation on HPC hardware is still open. A parallel version of a well-recognized Nagel–Schreckenberg theoretical traffic model (actually based on a specifically configured cellular automaton [22]) was proposed back in 1994 [21], which proved this possibility. More recent research [26], [19], [25], [18] has shown various scalability problems caused by synchronization overheads when the common model is updated by several computing nodes simultaneously.

Most commonly used traffic simulators, both open-source and commercial, rarely offer the possibility of accelerating the simulation by using multiple processors. The well-known SUMO simulator [20] is a single-process application. A distributed version of SUMO, called dSUMO has been presented in [5], however the authors utilize only 4 cores on 2 PCs. Another mature agent-based traffic simulation, MATSim [16], supports the parallel computing inside a single computing node. TRANSIMS open-source project, supported by Kai Nagel, has been used to create a distributed simulation [27], which improved performance, but also did not scale well. Commercial simulators, like EMME/2 [2] or PTV VISSIM [3] do not advertise the ability of using HPC infrastructures. AnyLogic, a very mature, commercial general-purpose simulation framework [1], supports execution in Cloud according to the claims by the supporting company, but no technical details are provided. There are also prototypes of simulation frameworks to be found in the literature (see, e.g. [31], [29]), however to our best knowledge they do not reach HPC-grade scalability, although the latter cited paper claims to offer a very efficient hybrid (CPU/GPGPU) simulation framework.

Having the HPC infrastructure at hand cannot be treated as attaining the Holy Grail of computing, as HPC-grade appliances are not so straightforward to implement, debug, nor use. This motivates research on new and alternative programming models, languages, and runtime systems. Starting from universal MPI-based systems [10], the technology evolved; recently, very efficient ways of leveraging HPC based on the utilization of functional languages have arisen. Indeed, we have already approached a similar simulation problem using Erlang [34], successfully obtaining and testing a scalable and efficient system. However, the steep learning curve of this technology does not make it a tool of choice for all HPC-oriented developers. Therefore, we also wanted to try to use very popular JVM-based tools (JVM - Java Virtual Machine); particularly, Scala technology, which has become greatly successful in joining the ubiquitous nature of Java with the ease and elegance of the functional paradigm.

In this paper, we present a highly scalable urban traffic simulation system implemented in Scala and Akka technology. Nowadays, Scala is a popular general-purpose programming language with support for functional programming and strong typing [24]. Akka is a toolkit that simplifies the construction of concurrent and distributed applications on the Java Virtual Machine (particularly well-known from the support of actor-based concurrency) with inspiration drawn from Erlang [12], [32].

These technologies have been designed to create massively parallel systems. They provide several mechanisms and tools dedicated to handling HPC hardware. The implemented simulation algorithm can be distributed between hundreds of computing nodes, providing almost linear scalability. The main contributions of our work are as follows:

  • Implementation of a new distributed car traffic simulation created entirely in Scala and Akka, making it easier to get to know with HPC computing for programmers who are familiar with the JVM environment.

  • Presentation of a series of experiments on state-of-the-art HPC infrastructure, showing the good scalability and efficiency results on up to 1000 nodes with 24,000 cores in total, proving the usability of the proposed framework.

The paper is organized as follows. In the next section, the parallel processing in Scala and Akka is discussed; the actual model of traffic in the parallel context is then described. The following section shows the implementation details of the simulation system using the previously mentioned Scala and Akka technologies. The scalability of the presented solution is tested and discussed in detail in Section 5. Finally, the paper is concluded, suggesting further research directions.

Section snippets

Scala and Akka framework in parallel processing

Most of the existing systems devoted to microscopic traffic simulation have been implemented using solutions based on the C and C++ languages. Such an approach allows authors to optimize applications for particular hardware architectures. In this paper, we focus on the Scala programming language and Akka implementation of the actor model.

Traffic model and parallel simulation algorithm

The considered computational task is a large-scale microscopic traffic simulation. The microscopic traffic models represent individual cars and drivers with detailed characteristics of their driving strategies and tactics.

The traffic model implemented in the presented simulation system is based on the classic well-recognized approach introduced by Nagel and Schreckenberg [22]. In this discrete model (which was originally designed to represent highway traffic), all lanes are divided into cells.

Implementation using Scala and Akka

The parallel simulation algorithm was implemented in Scala programming language using the Akka framework. Both of these tools used together provide a powerful foundation for creating applications designed to be run in distributed environments. The Akka framework allows us to easily implement systems using an actor model; this consists of several modules where Akka Remoting is especially valuable in terms of HPC application. It enhances the capabilities of the library with the ability to

Scalability evaluation

All tests of the created traffic simulation system were performed using Prometheus, the supercomputer of the Cyfronet AGH center in Krakow, Poland. In November 2018, it was classified in 131st place on the TOP500 list3 . Prometheus consists of more than 2200 HP Apollo 8000 servers, each containing two Intel Xeon E5-2860v3 CPUs that together have 24 physical cores. All of the nodes are connected with a high-speed Infiniband network offering a bandwidth of 56

Conclusions and future work

In this paper, we have shown that it is possible to successfully apply Scala and Akka for parallel car traffic simulation. Our implementation and experiments demonstrated the scalability on a cluster of 1000 nodes with 24,000 CPU cores in total. We also observed that the desynchronization mechanism applied in the algorithm has a significant influence on the efficiency of the solution. To the best of our knowledge, this is the first result of using Scala for such a large-scale simulation.

Acknowledgement

This research was supported in part by the PL-Grid Infrastructure (http://www.plgrid.pl/en). This research was supported by funds from the Polish Ministry of Science and Higher Education assigned to AGH University of Science and Technology in Krakow, Poland. We would like to express special gratitude to MichałCiołczyk for his help with the implementation and debugging.

Wojciech Turek obtained Ph.D. in 2010 and works as assistant professor at AGH University of Science and Technology in Krakow Poland. He is interested in parallel and distributed computing and simulation systems, multi-robot systems and functional programming.

References (38)

  • Ptv vissim. https://vision-traffic.ptvgroup.com/en-us/products/ptv-vissim/. Accessed:...
  • Bartosz Balis et al.

    Using an actor framework for scientific computing: Opportunities and challenges

    Comput. Inform.

    (2017)
  • Quentin Bragard et al.

    dSUMO: Towards a distributed SUMO

    Proc. of The first SUMO User Conference, Berlin 15-17 May.

    (2013)
  • Alexey Cheptsov

    Hpc in big data age: An evaluation report for java-based data-intensive applications implemented with hadoop and openmpi

    Proceedings of the 21st European MPI Users’ Group Meeting, EuroMPI/ASIA ’14, pages 175:175-175:180, New York, NY, USA. ACM

    (2014)
  • Christian Ego et al.

    Agent-based traffic control-a cyber-physical system approach

    Proc. of International Scientific Conference on Mobility and Transport - ITS for Connected Mobility, Munich

    (2013)
  • Saliya Ekanayake et al.

    Java thread and process performance for parallel machine learning on multicore HPC clusters.

    2016 IEEE International Conference on Big Data (Big Data). IEEE

    (2016)
  • Jörg Esser et al.

    Microscopic simulation of urban traffic based on cellular automata

    Int. J. Modern Phys. C

    (1997)
  • Message Passing Forum. Mpi: A message-passing interface standard., Technical report, University of Tennessee,...
  • D.L. Gerlough

    Simulation of Freeway Traffic on a General-purpose Discrete Variable Computer

    (1955)
  • Cited by (11)

    • RTVEMVS: Real-time modeling and visualization system for vehicle emissions on an urban road network

      2021, Journal of Cleaner Production
      Citation Excerpt :

      The development of the Geographic Information System in the Web framework has also provided strong support for the connection of traffic data and road network information on a visual Web platform. The emerging large-scale high-performance computing technology can also be optimized to reduce the time required for real-time modeling and large-scale computing (Sadler et al., 2019; Janczykowski et al., 2019), which has enabled progress in the establishment of a real-time system for vehicle emissions monitoring and estimation in urban environments. Therefore, the purpose of this study was to establish a real-time modeling and visualization system for vehicle emissions on an urban road network (RTVEMVS) to provide real-time vehicle emissions and “precise impact estimation” for supporting the “precise control”of vehicle emission.

    • A new alternating iteration strategy based on the proper orthogonal decomposition for solving large-scaled transient nonlinear heat conduction problems

      2020, Journal of Computational Science
      Citation Excerpt :

      The solutions of transient nonlinear heat conduction problems have always been a significant part of engineering applications [1,2] and numerical methods increasingly play an important role to solve this type of problems. With the fast development of high performance computing (HPC) hardware and numerical computations [3–6], some new algorithms need to be designed to fit current status. The conventional and widely used numerical methods such as finite element method(FEM), mesh free method (MFM), finite difference method (FDM), finite volume method (FVM), boundary element method (BEM), and some other innovative methods, have more or less drawbacks [7].

    • Research and Design of ETC Simulation Platform for Expressway

      2023, Xitong Fangzhen Xuebao / Journal of System Simulation
    View all citing articles on Scopus

    Wojciech Turek obtained Ph.D. in 2010 and works as assistant professor at AGH University of Science and Technology in Krakow Poland. He is interested in parallel and distributed computing and simulation systems, multi-robot systems and functional programming.

    Maciej Malawski obtained Ph.D. in 2009 and D.Sc. in 2017. He works as assistant professor at AGH University of Science and Technology in Krakow Poland. He is interested in high-performance computing and simulations, he also has strong experience in supporting high-energy physics experiments in CERN.

    Aleksander Byrski obtained Ph.D. in 2007 and D.Sc. in 2013. He works as associate professor at AGH University of Science and Technology in Krakow Poland. He is interested in parallel and distributed computing, metaheuristic computing and agent-based systems.

    View full text