README.md

DVCompute Simulator

DVCompute Simulator (registration number 2021660590 of Rospatent) is a general purpose discrete event simulator that allows creating sequential, nested and distributed simulation models. In the latter case the simulator implements both the optimistic Time Warp method and conservative one based on Null Message Algorithm. For that, the simulator will use the specified MPI implementation. You can use any MPI implementation that supports the corresponding standard.

The simulator supports the event oriented paradigm and the Observable pattern, which allows the simulator be suitable for modeling hardware such as digital integral circuits.

Also the simulator supports discontinuous processes and GPSS-like blocks, which allows the simulator be suitable for modeling queue networks.

Documentation

You can read the PDF document DVCompute Simulator Tutorial in the attached file.

Sequential Simulation

The source code is fully available in the DVCompute Simulator distribution for creating and running sequential simulation models. This is the main use case. Moreover, you can use WebAssembly.

Nested Simulation

The source code for nested simulation is available too. This type of nested simulation can be helpful for those who create strategic computer games, for example. You can imagine something like a chess play, where only moves are actions that affect the discrete event simulation model. It deserves more to say, but this is not for short README description. In short, the nested mode of simulation can be interesting for applications of Theory of Games.

Distributed Simulation

DVCompute Simulator supports the distributed simulation too, where two methods are implemented: the optimistic and conservative ones. The both methods are targeted for running simulation models on supercomputers with help of using the MPI protocol for communicating between logical processes.

The source code contains the corresponding MPI adapter so that you can compile the adapter for your specific MPI implementation. This is a programming library, which is called dvcompute_mpi. Its C++ sources are located in the src/dvcompute_mpi_cdylib directory. The corresponding subproject uses CMake to build the MPI adapter. There are helper scripts in the scripts directory.

To run the prepared examples, you should put your version of the MPI adapter in the lib directory.

However, to run distributed models, you will also have to use additional dynamic libraries. Here they will be a programming library dvcompute_core_dist for the optimistic method and dvcompute_core_cons for the conservative one. The libraries are not available in sources. They must implement the predefined binary interface expected by the simulator (each of the libraries must implement the event queue). The binary interface is a part of the simulator.

Here you can request me for some prebuilt versions that implement the corresponding interface. They may have some limitations during simulation. These prebuilt versions are part of the “Redistributable Code” portions of DVCompute Simulator and they are not related to this repository of source code.

To receive full versions, you will have to purchase a commercial license for the “Redistributable Code” portions of DVCompute Simulator.

Also to run the distributed models, you will have to help the operating system find the corresponding libraries. So, if you put them in the working directory, then the following actions will help (obligatorily consult your system administrator before you try to follow these instructions):

(a) On Linux it may look like something this:

  $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.

(b) On macOS it may be similar to

  $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:.

(c) On Windows there is no need in additional actions.

Unified Approach for Simulation

Finally, please note that the nested simulation module shares the same code base with the optimistic distributed simulation module. Moreover, that code base is very similar to the code base used by the sequential simulation module, where the main difference is that the former code extensively uses the cloning of closures. In the rest, they are conceptually the same. This is one approach, one method. Similarly, the conservative module shares the same code base with the sequential module.

Therefore, you can transfer your simulation models between different modules. For example, you may start working with the sequential model, but then you can translate it into a distributed simulation model or nested one.

History and Bibliography

Earlier I created the Aivika simulation framework written in Haskell. It is available by the following link: http://hackage.haskell.org/package/aivika

Then I continued working on simulators, and DVCompute Simulator is my further work.

Here is a list of my publications.

  • This is my scientific article about some details of the implementation:

    • Sorokin David. DVCompute Simulator for discrete event simulation. Prikladnaya informatika=Journal of Applied Informatics, 2021, vol.16, no.3, pp.93-108 (in Russian). DOI: 10.37791/2687-0649-2021-16-3-93-108
  • This is my scientific article about the main idea of my method:

    • Sorokin David. Distributed simulation with Aivika. Prikladnaya Informatika=Journal of Applied Informatics, 2019, vol.14, no. 4(82), pp.73-89 (in Russian). DOI: 10.24411/1993-8314-2019-10028
  • There is also an article (in Russian) published in theses of The Eight All-Russia Scientific-Practical Conference on Simulation and its Application in Science and Industry “Simulation. The Theory and Practice” (“IMMOD-2017”) that was held October 18-20 in Saint Petersburg:

    • Sorokin D.E. Connection-level Fault-tolerant Distributed Simulation with Aivika
  • The main idea of my simulation method is described too in an article (in Russian) published in theses of The Seven All-Russia Scientific-Practical Conference on Simulation and its Application in Science and Industry “Simulation. The Theory and Practice” (“IMMOD-2015”) that was held October 21-23 in Moscow:

    • Sorokin D.E. Aivika: Modeling and Simulation in Terms of Computations

Running Samples and Tests

If you want to run an example, then I would recommend to start from the model of the Closed Queue Network. This model is often used for testing simulators.

You can find the following versions:

  • Model samples/dvcompute_cqn. This is a sequential mode of simulation;

  • Model samples/dvcompute_cqn_pseudo. It contains a single logical process, but it uses an optimistic distributed simulation module already, although without message passing for this particular model. It allows estimating the load created by the very support of the optimistic Time Warp method;

  • Model samples/dvcompute_cqn_dist. This is a true distributed simulation model, where each queue tandem is processed by separate logical process. The optimistic Time Warp method is used;

  • Model samples/dvcompute_cqn_cons. This is a true distributed simulation model too, where each queue tandem is processed by separate logical process, but the conservative Null Message Algorithm is used already.

If you do not want to use additional libraries, then you can start from the first model. It will not require additional settings.

Licence

Copyright 2020-2022 David Sorokin davsor@mail.ru, based in Yoshkar-Ola, Russia

This repository of source code contains a public part of DVCompute Simulator, which is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

The “Redistributable Code” portions of DVCompute Simulator can be subject to proprietary licenses.


Best regards,

David Sorokin davsor@mail.ru Yoshkar-Ola, Mari El, Russia

Описание

Программный комплекс для дискретно-событийного моделирования (Discrete Event Simulation Framework)

Конвейеры
0 успешных
0 с ошибкой