Process-Based Simulation with Stackless Coroutines
Overview
This repository contains the source code for the simulator core discussed in our IST 2021 paper.
In order to run the examples and benchmarks, you should install the Rust-compiler, SLX and a C++ compiler first.
Any C++-14 conforming compiler should work, the ODEMx-library is translated using Rust code that searches for a compiler
first, so the popular compilers msvc
, clang
, mingw
and gcc
should all work out of the box.
Unfortunately, there is no way to get SLX at the moment, as the creator James O. Henriksen passed away in 2020, and the company's original website has vanished. We are unsure if it would be legal for us to provide you with the demo version in the context of this repository, so we opted against it. Please contact us if you wish to obtain the free version of SLX for your own benchmarks.
The src/
directory contains the source code for our simulator core simcore-rs as well as the decompressor-tokenizer
example from the paper. The folder examples/
contains the Barbershop, Car Ferry and Dining Philosopher examples
including the code used for the comparative benchmarks. In slx/
one can find the SLX-code for the same examples,
also including benchmarking provisions in the form of (real time) measurements. The cpp/
folder contains three
sub-projects for the three examples that use ODEMx. The results/
directory contains the complete report for our
benchmarking results. Finally, the odemx-lite/
folder contains a pure version of ODEMx, that is pure in the sense
that all external dependencies have been stripped, and it only requires a C++-14 conforming compiler to be translated.
Executing the Sample Code
You may execute the decompressor-tokenizer example using cargo run --bin coroutines
and the other examples using
cargo run --example <name>
for <name>
in [barbershop, ferry, philosophers]. For the benchmarks enter
cargo bench
into your terminal (or cargo bench --example <name>
if you wish to run a specific benchmark).
Cargo will download and compile all the dependencies for you.
Should you wish to execute the SLX code as well, you will need to obtain a version of SLX first. The free student version is sufficient to run the benchmarks but is about 30% slower than the full version of SLX due to its generation of 32-bit binaries rather than 64-bit binaries like the full version does.
Benchmarks
We executed the benchmarks under Windows 10 on an Intel Core i7-10750H processor with 6 cores (12 with hyper-threading) and 32 GB DDR4 RAM with activated link-time optimizations and optimization level 3.
You can find the results under results/criterion/report/index.html
for all three simulation systems.