Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Switch s4u tuto to pajengr as well.
authordegomme <adegomme@users.noreply.github.com>
Fri, 8 Mar 2019 11:05:11 +0000 (12:05 +0100)
committerdegomme <adegomme@users.noreply.github.com>
Fri, 8 Mar 2019 11:05:37 +0000 (12:05 +0100)
docs/source/Tutorial_Algorithms.rst
docs/source/tuto_s4u/draw_gantt.R
tools/docker/Dockerfile.tuto-s4u

index 27552d5..e12657f 100644 (file)
@@ -345,6 +345,14 @@ Debian and Ubuntu for example, you can get them as follows:
 
    sudo apt install simgrid pajeng cmake g++ vite
 
+For R analysis of the produced traces, you may want to install R, 
+and the `pajengr<https://github.com/schnorr/pajengr#installation/>_ package.
+
+.. code-block:: shell
+
+   sudo apt install r-base r-cran-devtools cmake flex bison
+   Rscript -e "library(devtools); install_github('schnorr/pajengr');"
+
 An initial version of the source code is provided on framagit. This
 template compiles with cmake. If SimGrid is correctly installed, you
 should be able to clone the `repository
@@ -408,8 +416,7 @@ and use it as follows:
 .. code-block:: shell
 
    ./master-workers small_platform.xml master-workers_d.xml --cfg=tracing:yes --cfg=tracing/msg/process:yes
-   pj_dump --ignore-incomplete-links simgrid.trace | grep STATE > gantt.csv
-   Rscript draw_gantt.R gantt.csv
+   Rscript draw_gantt.R simgrid.trace
 
 It produces a ``Rplots.pdf`` with the following content:
 
index 5fd230b..f3ab44d 100644 (file)
@@ -1,16 +1,17 @@
 #!/usr/bin/env Rscript
 args = commandArgs(trailingOnly=TRUE)
 library(ggplot2)
+library(pajengr)
 
 # Load and relabel the data
-df = read.csv(args[1], header=F, strip.white=T)
-names(df) = c("Type", "Actor", "Container", "Start", "End", "Duration", "Level", "State");
+df = pajeng_read(args[1])
+names(df$state) = c("Type", "Actor", "Container", "Start", "End", "Duration", "Level", "State");
 
 # Actually draw the graph
-p = ggplot(df) + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor,color=State), size=5);
+p = ggplot(df$state) + geom_segment(aes(x=Start, xend=End, y=Actor, yend=Actor,color=State), size=5);
 
 # Cosmetics to compact the resulting graph
-p.height <- length(unique(df$Actor)) * 0.05 + 2;
+p.height <- length(unique(df$state$Actor)) * 0.05 + 2;
 pdf(height = p.height)
 
 # Produce the pdf file
index 022b01e..ff7ddcc 100644 (file)
@@ -3,8 +3,10 @@ FROM simgrid/stable
 
 # - Clone simgrid-template-s4u, as it is needed by the tutorial
 # - Add an empty makefile advising to run cmake before make, just in case
-RUN apt update && apt install -y pajeng r-base r-cran-ggplot2 r-cran-dplyr cmake g++ git libboost-all-dev&& \
+RUN apt update && apt install -y pajeng r-base r-cran-ggplot2 r-cran-dplyr r-cran-devtools cmake g++ git libboost-all-dev flex bison&& \
     cd /source && \
     git clone --depth=1 https://framagit.org/simgrid/simgrid-template-s4u.git simgrid-template-s4u.git && \
     printf "master-workers ping-pong:\n\t@echo \"Please run the following command before make:\";echo \"    cmake .\"; exit 1" > Makefile &&\
-    apt autoremove -y && apt clean && apt autoclean
\ No newline at end of file
+    apt autoremove -y && apt clean && apt autoclean
+
+RUN Rscript -e "library(devtools); install_github('schnorr/pajengr');"