From 99bab12ba7fb797e4a9cd31be0ad91d705a2364f Mon Sep 17 00:00:00 2001 From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr> Date: Thu, 7 Mar 2019 15:05:01 +0100 Subject: [PATCH] Add a small documentation --- doc/README.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/README.org | 72 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 doc/README.md create mode 100644 doc/README.org diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 00000000..907547cc --- /dev/null +++ b/doc/README.md @@ -0,0 +1,81 @@ +- [Dot files](#orgb64a426) +- [Algorithms](#orgcbdd346) +- [Installation (not yet working)](#org5811f90) + +Basically, one needs to provide + +1. a dot file +2. the algorithms mentionned in the dot file + + +<a id="orgb64a426"></a> + +# Dot files + +Dot files should + +- follow the graphviz/dot format (cf <https://en.wikipedia.org/wiki/DOT_(graph_description_language)>). +- contain nodes labelled by the `algo` field + +```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 +} +``` + + +<a id="orgcbdd346"></a> + +# 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 + +More precisely, each algorithm should provide 3 functions + +- `reg_vars` +- `reg_enable` +- `reg_step` + +which profile is defined in <../lib/algo/algo.mli> + +Each algorithm must then register them (using `reg_vars`, `reg_enable`, and `reg_step` respectively). + +Algorithms must then be compiled with `ocamlopt -shared` to produce the cmxs files mentionned in the dot. + +```sh +ocamlopt -shared -I +sasa algo.ml -o algo.cmxs +``` + +Some examples can be found in the <./test/> directory. + + +<a id="org5811f90"></a> + +# 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 +``` \ No newline at end of file diff --git a/doc/README.org b/doc/README.org new file mode 100644 index 00000000..18227856 --- /dev/null +++ b/doc/README.org @@ -0,0 +1,72 @@ + + + +Basically, one needs to provide +1. a dot file +2. the algorithms mentionned in the dot file + +* Dot files + +Dot files should +- follow the graphviz/dot format (cf + https://en.wikipedia.org/wiki/DOT_(graph_description_language)). +- contain nodes labelled by the =algo= field + +#+BEGIN_SRC 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 +} +#+END_SRC + + +* 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 + +More precisely, each algorithm should provide 3 functions +- =reg_vars= +- =reg_enable= +- =reg_step= +which profile is defined in file:../lib/algo/algo.mli + +Each algorithm must then register them (using =reg_vars=, =reg_enable=, +and =reg_step= respectively). + +Algorithms must then be compiled with =ocamlopt -shared= to produce +the cmxs files mentionned in the dot. + +#+BEGIN_SRC sh +ocamlopt -shared -I +sasa algo.ml -o algo.cmxs +#+END_SRC + +Some examples can be found in the file:./test/ directory. + +* Installation (not yet working) + +#+BEGIN_SRC sh :tangle sh/install-opam.sh :noweb yes :tangle-mode (identity #o444) +# 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 +#+END_SRC + +Once is is done, upgrading to the last version of the tools is as +simple as: + +#+BEGIN_SRC yaml +opam update +opam upgrade +#+END_SRC + -- GitLab