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
.. 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:
#!/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
# - 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');"