Skip to content
Snippets Groups Projects
user avatar
Dorian Weber authored
Refactoring of unrelated fields in the Calendar into the Simulator, documentation, some performance improvements, and renaming of some structures to bring them closer to ODEM-rs.
4f269b7c

A Closer Look at Process-Based Simulation with Stackless Coroutines

Overview

This repository contains the source code for the simulator core discussed in our IST 2021 paper as well as code needed to run and benchmark the sample scenarios from the 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 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 to generate 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 c/ folder contains the manually transformed version of the decompressor-tokenizer example into coroutines in C as well as a Makefile for compilation. 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 clean version of ODEMx, that has all external dependencies stripped and 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 analogous example in C, change into the c/ directory and call make run. Note that the example reads from stdin, so this path requires manual input from the terminal. 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 automatically.

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.