Line data Source code
1 0 : # The ROme OpTimistic Simulator (ROOT-Sim) 3.0.0 2 : 3 : [](https://github.com/ROOT-Sim/core/actions) 4 : [](https://codecov.io/gh/ROOT-Sim/core) 5 : [](https://www.codacy.com/gh/ROOT-Sim/core/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ROOT-Sim/core&utm_campaign=Badge_Grade) 6 : [](https://root-sim.github.io/core/docs/) 7 : [](https://github.com/ROOT-Sim/core/issues) 8 : [](https://github.com/ROOT-Sim/core/blob/master/COPYING) 9 : 10 : *Brought to you by the [High Performance and Dependable Computing Systems (HPDCS)](https://hpdcs.github.io/) Research Group* 11 : 12 : ---------------------------------------------------------------------------------------- 13 : 14 : The ROme OpTimistic Simulator is an x86-64 Open Source, distributed multithreaded parallel simulation library developed using C/POSIX technology. It transparently supports all the mechanisms associated with parallelization and distribution of workload across the nodes (e.g., mapping of simulation objects on different kernel instances) and optimistic synchronization (e.g., state recoverability). 15 : Distributed simulations rely on MPI3. In particular, global synchronization across the different nodes relies on asynchronous MPI primitives, for increased efficiency. 16 : 17 : The programming model supported by ROOT-Sim allows the simulation model developer to use a simple application-callback function named `ProcessEvent()` as the event handler, whose parameters determine which simulation object is currently taking control for processing its next event, and where the state of this object is located in memory. An object is a data structure, whose state can be scattered on dynamically allocated memory chunks, hence the memory address passed to the callback locates a top level data structure implementing the object state-layout. 18 : 19 : ROOT-Sim's development started as a research project late back in 1987, and is currently maintained by the High Performance and Dependable Computing Systems group, a joint research group between Sapienza, University of Rome and University of Rome "Tor Vergata". 20 : 21 : ## Dependencies 22 : 23 : To build the project you need a C11 compiler such as GCC 8 or a later version, and the Meson build system. 24 : 25 : ## Building and installing 26 : 27 : Run: 28 : 29 : ```bash 30 : meson build -Dprefix={installdir} 31 : cd build 32 : ninja test 33 : ninja install 34 : ``` 35 : 36 : where `{installdir}` is your preferred installation directory expressed as an absolute path.\ 37 : Alternatively you can skip the `-Dprefix` altogether: ROOT-Sim will be installed in your system directories. 38 : 39 : ## Compile and run a model 40 : 41 : ROOT-Sim ships with two sample models in the `models` folder of the project: `pcs` and `phold`. For example, to compile the `pcs` model simply run: 42 : 43 : ```bash 44 : cd models/pcs 45 : {installdir}/bin/rootsim-cc *.c 46 : ``` 47 : 48 : If you installed ROOT-Sim system-wide the second command becomes simply: 49 : 50 : ```bash 51 : rootsim-cc *.c -o model 52 : ``` 53 : 54 : To test the correctness of the model, it can be run sequentially, typing: 55 : 56 : ```bash 57 : ./model --serial --lp <number of required LPs> This allows to spot errors in the implementation more easily. 58 : ``` 59 : 60 : Then, to run it in parallel, type: 61 : ```bash 62 : ./model --wt <number of desired threads> --lp <number of required LPs> 63 : ``` 64 : 65 : To run in a distributed environment, you can use standard MPI commands, such as: 66 : 67 : ```bash 68 : mpiexec -n 2 --hostfile hosts --map-by node ./model --wt 2 --lp 16 69 : ``` 70 : 71 : This command runs the simulation model on two nodes (`-n 2`) specified in the hosts file. Each node uses two concurrent threads (`--wt 2`). The simulation involves 16 total Logical Processes (`--lp 16`). 72 :