-[Running batch simulations with Built-in daemons](#org489a669)
-[Running batch simulations with Built-in daemons](#org954c5e6)
-[Running batch simulations with manual (a.k.a. custom) daemons](#org14c0bf6)
-[Running batch simulations with manual (a.k.a. custom) daemons](#org38d5de5)
-[Running batch simulations with `lurette`](#orgae85a46)
-[Running batch simulations with `lurette`](#org640b2e9)
-[Viewing Results](#orgd0df37c)
-[Viewing Results](#org3d147ea)
-[The `sasa` CLI](#org3826451)
-[The `sasa` CLI](#orgdf60ab4)
-[Interactive mode](#org51d255d)
-[Interactive mode](#org5baaeee)
-[Example: use `rdbg` from the `test/alea-coloring/` directory](#orgf1f33df)
-[Example: use `rdbg` from the `test/alea-coloring/` directory](#org5b2cfb9)
-[The examples of test directory](#orgba2643a)
-[The examples of test directory](#org2652e6e)
-[Running interactive sessions with `rdbg`](#org8e0608b)
-[Running interactive sessions with `rdbg`](#org1dab3bd)
-[Getting `rdbg` on-line help](#orga0e4b56)
-[Getting `rdbg` on-line help](#org262e448)
-[A `rdbg` `sasa` GUI](#orgc178a5b)
-[A `rdbg` `sasa` GUI](#org4285bff)
-[Useful Modules](#org104bb05)
-[Useful Modules](#org8d90a8b)
-[Install](#org82c0381)
-[Install](#orgee0d8a4)
-[TL;DR](#orgaa9dedc)
-[TL;DR](#org106f46f)
-[Not strictly mandatory, but useful, third-party software](#org73fe296)
-[Not strictly mandatory, but useful, third-party software](#orgc700b1f)
-[Install `sasa` via opam (version >= 2.\*)](#org73891dc)
-[Install `sasa` via opam (version >= 2.\*)](#org32e5593)
-[Install `sasa` via `git`](#org0593787)
-[Install `sasa` via `git`](#orgaaeaaee)
-[Use `sasa` via docker](#orgc204a38)
-[Use `sasa` via docker](#org0cca00b)
-[Use `sasa` via a Virtual Machine](#org6a314b3)
-[Use `sasa` via a Virtual Machine](#org30a0cfb)
-[Screencasts](#org823ffcf)
-[Screencasts](#orgcaa736c)
-[More](#org92ef883)
-[More](#org0558eb8)
-[FAQ](#org7a3d43b)
-[FAQ](#org6abdd10)
-[Is there a FAQ?](#orgc33433c)
-[Is there a FAQ?](#orgc6dc2c8)
-[I have a compilation error that I don't understand](#orgebe736a)
-[I have a compilation error that I don't understand](#org169d469)
-[I have the error `Invalid_argument("compare: functional value")`](#orge399e50)
-[I have the error `Invalid_argument("compare: functional value")`](#orga5fc6a4)
<aid="orgfb6de52"></a>
<aid="org5ad0e66"></a>
# TL;DR
# TL;DR
<aid="orgee82fbd"></a> SASA is a **Self-stabilizing Algorithms SimulAtor**, based on the so-called **Atomic State model** (ASM) introduced by <spanclass="underline">Dijkstra</span> in its seminal article on [Self-stabilizing distributed algorithms](http://www.cs.utexas.edu/~EWD/ewd04xx/EWD426.PDF). This model is also sometimes named "locally shared memory model with composite atomicity"
<aid="org9bed122"></a> SASA is a **Self-stabilizing Algorithms SimulAtor**, based on the so-called **Atomic State model** (ASM) introduced by <spanclass="underline">Dijkstra</span> in its seminal article on [Self-stabilizing distributed algorithms](http://www.cs.utexas.edu/~EWD/ewd04xx/EWD426.PDF). This model is also sometimes named "locally shared memory model with composite atomicity"
Basically, one needs to provide:
Basically, one needs to provide:
...
@@ -55,17 +55,18 @@ sasa ring.dot -l 4 # run a batch simulation for 4 steps
...
@@ -55,17 +55,18 @@ sasa ring.dot -l 4 # run a batch simulation for 4 steps
<aid="org32c18d2"></a><aid="orga2b2179"></a> The topology is given via `.dot` files, that should
<aid="orge3bca28"></a><aid="orgdeb8329"></a> The topology is given via `.dot` files, that should
1. follow the [graphviz/dot format](https://en.wikipedia.org/wiki/DOT_(graph_description_language))
1. follow the [graphviz/dot format](https://en.wikipedia.org/wiki/DOT_(graph_description_language))
2. have nodes **labeled** by the `algo` field
2. have nodes **labeled** by the `algo` field
...
@@ -123,14 +124,14 @@ graph ring {
...
@@ -123,14 +124,14 @@ graph ring {
Such parameters can be retrieved in algorithms using the `Algo.get_graph_attribute : string -> string` function. For example, if you know the graph diameter, you can define it as a graph attribute (a `Algo.diameter: unit -> int` function is provided, but it can be expensive to use for large graphs).
Such parameters can be retrieved in algorithms using the `Algo.get_graph_attribute : string -> string` function. For example, if you know the graph diameter, you can define it as a graph attribute (a `Algo.diameter: unit -> int` function is provided, but it can be expensive to use for large graphs).
Some tools are provided in the `sasa`[distributions](#org8d572c2) to generate such kinds of `dot` graphs: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-gg/>
Some tools are provided in the `sasa`[distributions](#org90b15f9) to generate such kinds of `dot` graphs: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-gg/>
<aid="org59056c6"></a>
<aid="orge32cab3"></a>
# Algorithms
# Algorithms
<aid="orgda68756"></a>
<aid="org2f3c3e8"></a>
The following has been generated from [algo.mli](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/blob/master/lib/algo/algo.mli)
The following has been generated from [algo.mli](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/blob/master/lib/algo/algo.mli)
...
@@ -142,7 +143,7 @@ The following has been generated from [algo.mli](https://gricad-gitlab.univ-gren
...
@@ -142,7 +143,7 @@ The following has been generated from [algo.mli](https://gricad-gitlab.univ-gren
</iframe>
</iframe>
<aid="orgcb4db19"></a>
<aid="orgcfde991"></a>
# Examples
# Examples
...
@@ -182,14 +183,14 @@ The `test` directory also contains sub-directories which gathers programs shared
...
@@ -182,14 +183,14 @@ The `test` directory also contains sub-directories which gathers programs shared
-`test/*/my-rdbg-tuning.ml`: includes `test/my-rdbg-tuning.ml` and defines commands specific to the example of the directory. Indeed, `rdbg`, once launched, first tries to read the content of the file name `my-rdbg-tuning.ml` (if it exists).
-`test/*/my-rdbg-tuning.ml`: includes `test/my-rdbg-tuning.ml` and defines commands specific to the example of the directory. Indeed, `rdbg`, once launched, first tries to read the content of the file name `my-rdbg-tuning.ml` (if it exists).
<aid="orgf3689c0"></a>
<aid="org80aeb83"></a>
# Batch mode
# Batch mode


<aid="orgd68d0b3"></a>
<aid="org9f35d61"></a>
## Running batch simulations
## Running batch simulations
...
@@ -230,37 +231,30 @@ All the CLI commands above can be run automatically using a `make` rule containe
...
@@ -230,37 +231,30 @@ All the CLI commands above can be run automatically using a `make` rule containe
#outs 1 1 0 0 1 0 1 t t t t f f t f t t t f f t f 6. f 0
#outs 0 1 0 0 1 0 0 t f t t f t t f f t f f t t f 6. f 0
#step 1
#step 1
#outs 1 2 2 2 1 0 2 f t t t f f f f f t t f f f f 4. t 2
#outs 0 1 2 0 1 2 1 f f f f f f f f f f f f f f t 0. t 1
#step 2
#outs 1 2 0 0 1 0 2 f f t t f f f f f t f f f f f 2. t 3
#step 3
#outs 1 2 1 0 1 0 2 f f f f f f f f f f f f f f t 0. t 3
This algo is silent after 7 moves, 3 steps, 3 rounds.
This algo is silent after 3 moves, 1 step, 1 round.
#quit
#quit
nb: the simulation output (in the green frame) follows the [RIF](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-orga43b00b) conventions.
nb: the simulation output (in the green frame) follows the [RIF](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-orga43b00b) conventions.
<aid="org489a669"></a>
<aid="org954c5e6"></a>
## Running batch simulations with Built-in daemons
## Running batch simulations with Built-in daemons
...
@@ -279,7 +273,7 @@ sasa -h | grep "\-daemon"
...
@@ -279,7 +273,7 @@ sasa -h | grep "\-daemon"
--greedy-daemon, -gd
--greedy-daemon, -gd
<aid="org14c0bf6"></a>
<aid="org38d5de5"></a>
## Running batch simulations with manual (a.k.a. custom) daemons
## Running batch simulations with manual (a.k.a. custom) daemons
...
@@ -317,7 +311,7 @@ In order to enter such input more easily, one can use (requires [the lustre V4 t
...
@@ -317,7 +311,7 @@ In order to enter such input more easily, one can use (requires [the lustre V4 t
Daemons can also by simulated by [`lutin`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-4) programs via the use of [`lurette`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-9)(for batch executions) or [`rdbg`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-10)(for interactive sessions).
Daemons can also by simulated by [`lutin`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-4) programs via the use of [`lurette`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-9)(for batch executions) or [`rdbg`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-10)(for interactive sessions).
<aid="orgae85a46"></a>
<aid="org640b2e9"></a>
## Running batch simulations with `lurette`
## Running batch simulations with `lurette`
...
@@ -342,14 +336,14 @@ Note that for `lurette`, the role of the SUT (System Under Test) and the one of
...
@@ -342,14 +336,14 @@ Note that for `lurette`, the role of the SUT (System Under Test) and the one of
For more information on this topic: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-daemons/>
For more information on this topic: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-daemons/>
<aid="orgd0df37c"></a>
<aid="org3d147ea"></a>
## Viewing Results
## Viewing Results
`sasa -rif` and `lurette` generates `.rif` files that can be viewed with `gnuplot-rif` or `sim2chro`; cf <http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/reactive-toolbox/>
`sasa -rif` and `lurette` generates `.rif` files that can be viewed with `gnuplot-rif` or `sim2chro`; cf <http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/reactive-toolbox/>
<aid="org3826451"></a>
<aid="orgdf60ab4"></a>
## The `sasa` CLI
## The `sasa` CLI
...
@@ -436,11 +430,11 @@ More `sasa` options:
...
@@ -436,11 +430,11 @@ More `sasa` options:
Display the version ocaml version sasa was compiled with and exit.
Display the version ocaml version sasa was compiled with and exit.
<aid="org51d255d"></a>
<aid="org5baaeee"></a>
# Interactive mode
# Interactive mode
<aid="org62bde61"></a> If you want to perform step-by-step simulations, you can use the `-custd` option. But if you want to perform step-by-step simulations without the burden of playing the role of the daemon, you can launch `sasa` under the control of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/).
<aid="org3d0da66"></a> If you want to perform step-by-step simulations, you can use the `-custd` option. But if you want to perform step-by-step simulations without the burden of playing the role of the daemon, you can launch `sasa` under the control of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/).
Another advantage of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/) is its ability to display a graphical view of the current configuration during the simulation, to move step by step, or round by round, forward or backwards.
Another advantage of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/) is its ability to display a graphical view of the current configuration during the simulation, to move step by step, or round by round, forward or backwards.
Before reading this section, please read at least the [Basic usage Section if the rdbg documentation](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/README.html#outline-container-sec-3).
Before reading this section, please read at least the [Basic usage Section if the rdbg documentation](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/README.html#outline-container-sec-3).
<aid="orgf1f33df"></a>
<aid="org5b2cfb9"></a>
## Example: use `rdbg` from the `test/alea-coloring/` directory
## Example: use `rdbg` from the `test/alea-coloring/` directory
...
@@ -492,7 +486,7 @@ rdbg
...
@@ -492,7 +486,7 @@ rdbg
[q] quit
[q] quit
<aid="orgba2643a"></a>
<aid="org2652e6e"></a>
## The examples of test directory
## The examples of test directory
...
@@ -503,7 +497,7 @@ The [test](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/t
...
@@ -503,7 +497,7 @@ The [test](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/t
-`test/*/my-rdbg-tuning.ml`: includes `test/my-rdbg-tuning.ml` and defines commands specific to the example of the directory. Indeed, `rdbg`, once launched, first tries to read the content of the file name `my-rdbg-tuning.ml` (it it exists).
-`test/*/my-rdbg-tuning.ml`: includes `test/my-rdbg-tuning.ml` and defines commands specific to the example of the directory. Indeed, `rdbg`, once launched, first tries to read the content of the file name `my-rdbg-tuning.ml` (it it exists).
<aid="org8e0608b"></a>
<aid="org1dab3bd"></a>
## Running interactive sessions with `rdbg`
## Running interactive sessions with `rdbg`
...
@@ -520,7 +514,7 @@ The [test](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/t
...
@@ -520,7 +514,7 @@ The [test](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/t
All those commands are defined in (the common) [test/my-rdbg-tuning.ml](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/tree/master/test/my-rdbg-tuning.ml) that is included in (locals) `test/*/my-rdbg-tuning.ml` that are included in (generated) `test/*/rdbg-session.ml` files. `my-rdbg-tuning.ml` contains straigthforward `ocaml` code that defines various `rdbg` shortcuts to ease the simulation of `sasa` systems. Feel free to tailor those command to yours needs by modyfying the local `my-rdbg-tuning.ml`!
All those commands are defined in (the common) [test/my-rdbg-tuning.ml](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/tree/master/test/my-rdbg-tuning.ml) that is included in (locals) `test/*/my-rdbg-tuning.ml` that are included in (generated) `test/*/rdbg-session.ml` files. `my-rdbg-tuning.ml` contains straigthforward `ocaml` code that defines various `rdbg` shortcuts to ease the simulation of `sasa` systems. Feel free to tailor those command to yours needs by modyfying the local `my-rdbg-tuning.ml`!
<aid="orga0e4b56"></a>
<aid="org262e448"></a>
## Getting `rdbg` on-line help
## Getting `rdbg` on-line help
...
@@ -616,7 +610,7 @@ Here are 2 useful entry-points to rdbg on-line help:
...
@@ -616,7 +610,7 @@ Here are 2 useful entry-points to rdbg on-line help:
(rdbg)
(rdbg)
<aid="orgc178a5b"></a>
<aid="org4285bff"></a>
## A `rdbg` `sasa` GUI
## A `rdbg` `sasa` GUI
...
@@ -630,7 +624,7 @@ opam install -y rdbgui4ocaml
...
@@ -630,7 +624,7 @@ opam install -y rdbgui4ocaml
To use it: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/rdbgui4sasa/>
To use it: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/rdbgui4sasa/>
<aid="org104bb05"></a>
<aid="org8d90a8b"></a>
## Useful Modules
## Useful Modules
...
@@ -665,14 +659,14 @@ Some modules, used by the sasa core engine, can be useful from `rdbg`.
...
@@ -665,14 +659,14 @@ Some modules, used by the sasa core engine, can be useful from `rdbg`.
One can also mimic the content of the `test` job in the project [.gitlab-ci.yml Gitlab CI script](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/tree/master/.gitlab-ci.yml).
One can also mimic the content of the `test` job in the project [.gitlab-ci.yml Gitlab CI script](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/tree/master/.gitlab-ci.yml).
<aid="orgc204a38"></a>
<aid="org0cca00b"></a>
## Use `sasa` via docker
## Use `sasa` via docker
cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#docker). This docker image contains all the tools mentioned in this section (`sasa`, `lustre`, `opam`, `ocaml`, emacs, graphviz, etc.).
cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#docker). This docker image contains all the tools mentioned in this section (`sasa`, `lustre`, `opam`, `ocaml`, emacs, graphviz, etc.).
<aid="org6a314b3"></a>
<aid="org30a0cfb"></a>
## Use `sasa` via a Virtual Machine
## Use `sasa` via a Virtual Machine
...
@@ -864,7 +858,7 @@ cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-ve
...
@@ -864,7 +858,7 @@ cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-ve
- passwd:sasa
- passwd:sasa
<aid="org823ffcf"></a>
<aid="orgcaa736c"></a>
# Screencasts
# Screencasts
...
@@ -880,7 +874,7 @@ cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-ve
...
@@ -880,7 +874,7 @@ cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-ve
Beside, some tutorials are also available here: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/tags/sasa/>
Beside, some tutorials are also available here: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/tags/sasa/>
<aid="orgebe736a"></a>
<aid="org169d469"></a>
## I have a compilation error that I don't understand
## I have a compilation error that I don't understand
...
@@ -913,7 +907,7 @@ Beside, some tutorials are also available here: <https://verimag.gricad-pages.un
...
@@ -913,7 +907,7 @@ Beside, some tutorials are also available here: <https://verimag.gricad-pages.un
- If the message is totally useless, please feel free to add an issue here <https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/issues>
- If the message is totally useless, please feel free to add an issue here <https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/issues>
<aid="orge399e50"></a>
<aid="orga5fc6a4"></a>
## I have the error `Invalid_argument("compare: functional value")`
## I have the error `Invalid_argument("compare: functional value")`