Skip to content
Snippets Groups Projects
README.md 1.77 KiB
Newer Older
erwan's avatar
erwan committed
- [Dot files](#org6667d72)
- [Algorithms](#org32323ab)
- [Simulation](#org0285ecd)
- [Installation (not yet working)](#orge431269)
erwan's avatar
erwan committed

Basically, one needs to provide

1.  a dot file
2.  the algorithms mentionned in the dot file


erwan's avatar
erwan committed
<a id="org6667d72"></a>
erwan's avatar
erwan committed

# Dot files

Dot files should

erwan's avatar
erwan committed
1.  follow the [graphviz/dot format](https://en.wikipedia.org/wiki/DOT_(graph_description_language)).
2.  contain nodes labelled by the `algo` field
erwan's avatar
erwan committed

```dot
graph ring {
 p1 [algo="some_algo.cmxs"]
 p2 [algo="some_algo.cmxs"]
 p3 [algo="some_algo.cmxs"]
 p4 [algo="some_algo.cmxs"]
 p5 [algo="some_algo.cmxs"]
 p6 [algo="some_algo.cmxs"]
 p7 [algo="some_algo.cmxs"]

 p1 -- p2 -- p3 -- p4 -- p5 -- p6 -- p7 -- p1 
}
```


erwan's avatar
erwan committed
<a id="org32323ab"></a>
erwan's avatar
erwan committed

# Algorithms

Those algorithms must provide:

1.  a set of variables (registers)
2.  an `enable` fonction that says which actions are enabled (i.e., that can be activated)
3.  a `step` function that executes enabled actions

erwan's avatar
erwan committed
More precisely, each algorithm should provide 3 functions that must be registred with:
erwan's avatar
erwan committed

-   `reg_vars`
-   `reg_enable`
-   `reg_step`

erwan's avatar
erwan committed
which profiles is defined in <../lib/algo/algo.mli>
erwan's avatar
erwan committed

Algorithms must then be compiled with `ocamlopt -shared` to produce the cmxs files mentionned in the dot.

```sh
erwan's avatar
erwan committed
ocamlopt -shared -I +sasa some_algo.ml -o some_algo.cmxs
erwan's avatar
erwan committed
```

Some examples can be found in the <./test/> directory.


erwan's avatar
erwan committed
<a id="org0285ecd"></a>

# Simulation

```sh
sasa some_topo.dot
sasa --help
```


<a id="orge431269"></a>
erwan's avatar
erwan committed

# Installation (not yet working)

```sh
# optional
opam repo add verimag-sync-repo "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/opam-repository"
opam update -y
opam depext -y sasa
opam install -y sasa
```

Once is is done, upgrading to the last version of the tools is as simple as:

```yaml
opam update
opam upgrade
```