From: Arnaud Giersch Date: Tue, 5 Mar 2013 09:39:09 +0000 (+0100) Subject: Finalize graph generation. X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba-papers.git/commitdiff_plain/804146a80986e500483810bf87b00c0b2cc361c6?ds=inline;hp=47d970c595adbdf48d5340fe34cf3d81b012788a Finalize graph generation. --- diff --git a/supercomp11/.gitignore b/supercomp11/.gitignore index 5c7f2f8..7bbf19f 100644 --- a/supercomp11/.gitignore +++ b/supercomp11/.gitignore @@ -2,3 +2,6 @@ supercomp11.pdf supercomp11.ps data/results.done +data/results2.done + +data/graphs/[IR][1N]-1*:1*-[gc]*[dr]-[hlt]*[es].pdf diff --git a/supercomp11/data/Makefile b/supercomp11/data/Makefile index 85cc01d..afb1ba6 100644 --- a/supercomp11/data/Makefile +++ b/supercomp11/data/Makefile @@ -1,3 +1,9 @@ +SHELL = /bin/bash + +.PHONY: all + +all: all.pdf all2.pdf allgraphs.pdf + all.pdf: all.tex results.done pdflatex all.tex @@ -6,4 +12,19 @@ all.tex: genalltex results.done: alldata plot plotall ./plotall - touch results.done + touch $@ + +all2.pdf: all2.tex results2.done + pdflatex all2.tex + +all2.tex: genalltex2 + ./genalltex2 > all2.tex + +results2.done: data.rda script.r + R --no-save < script.r + touch $@ + +allgraphs.pdf: results2.done + pdfunite \ + graphs/{R,I}{1,N}-{10:1,1:1,1:10}-{cluster,grid}-{line,torus,hcube}.pdf \ + $@ diff --git a/supercomp11/data/all2.pdf b/supercomp11/data/all2.pdf new file mode 100644 index 0000000..30ccad8 Binary files /dev/null and b/supercomp11/data/all2.pdf differ diff --git a/supercomp11/data/all2.tex b/supercomp11/data/all2.tex new file mode 100644 index 0000000..26b37b6 --- /dev/null +++ b/supercomp11/data/all2.tex @@ -0,0 +1,152 @@ +\documentclass[a4paper]{article} + +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{lmodern} +\usepackage[margin=1.5cm]{geometry} +\usepackage{graphicx} +\usepackage[francais]{babel} + +%%% workaround warnings about PDF 1.5 not supported +\pdfminorversion 5 + +\AtBeginDocument{\shorthandoff{:}} + +\newcommand{\IG}[1]{% + \includegraphics[width=6cm]{#1}} + +\begin{document} + +\begin{figure} + \centering + \IG{graphs/R1-10:1-cluster-line.pdf}% + \IG{graphs/R1-10:1-cluster-torus.pdf}% + \IG{graphs/R1-10:1-cluster-hcube.pdf}% + + \IG{graphs/R1-10:1-grid-line.pdf}% + \IG{graphs/R1-10:1-grid-torus.pdf}% + \IG{graphs/R1-10:1-grid-hcube.pdf}% + + \IG{graphs/RN-10:1-cluster-line.pdf}% + \IG{graphs/RN-10:1-cluster-torus.pdf}% + \IG{graphs/RN-10:1-cluster-hcube.pdf}% + + \IG{graphs/RN-10:1-grid-line.pdf}% + \IG{graphs/RN-10:1-grid-torus.pdf}% + \IG{graphs/RN-10:1-grid-hcube.pdf}% + + \caption{Real mode, comp/comm ratio${} = 10:1$.} +\end{figure} +\clearpage + +\begin{figure} + \centering + \IG{graphs/R1-1:1-cluster-line.pdf}% + \IG{graphs/R1-1:1-cluster-torus.pdf}% + \IG{graphs/R1-1:1-cluster-hcube.pdf}% + + \IG{graphs/R1-1:1-grid-line.pdf}% + \IG{graphs/R1-1:1-grid-torus.pdf}% + \IG{graphs/R1-1:1-grid-hcube.pdf}% + + \IG{graphs/RN-1:1-cluster-line.pdf}% + \IG{graphs/RN-1:1-cluster-torus.pdf}% + \IG{graphs/RN-1:1-cluster-hcube.pdf}% + + \IG{graphs/RN-1:1-grid-line.pdf}% + \IG{graphs/RN-1:1-grid-torus.pdf}% + \IG{graphs/RN-1:1-grid-hcube.pdf}% + + \caption{Real mode, comp/comm ratio${} = 1:1$.} +\end{figure} +\clearpage + +\begin{figure} + \centering + \IG{graphs/R1-1:10-cluster-line.pdf}% + \IG{graphs/R1-1:10-cluster-torus.pdf}% + \IG{graphs/R1-1:10-cluster-hcube.pdf}% + + \IG{graphs/R1-1:10-grid-line.pdf}% + \IG{graphs/R1-1:10-grid-torus.pdf}% + \IG{graphs/R1-1:10-grid-hcube.pdf}% + + \IG{graphs/RN-1:10-cluster-line.pdf}% + \IG{graphs/RN-1:10-cluster-torus.pdf}% + \IG{graphs/RN-1:10-cluster-hcube.pdf}% + + \IG{graphs/RN-1:10-grid-line.pdf}% + \IG{graphs/RN-1:10-grid-torus.pdf}% + \IG{graphs/RN-1:10-grid-hcube.pdf}% + + \caption{Real mode, comp/comm ratio${} = 1:10$.} +\end{figure} +\clearpage + +\begin{figure} + \centering + \IG{graphs/I1-10:1-cluster-line.pdf}% + \IG{graphs/I1-10:1-cluster-torus.pdf}% + \IG{graphs/I1-10:1-cluster-hcube.pdf}% + + \IG{graphs/I1-10:1-grid-line.pdf}% + \IG{graphs/I1-10:1-grid-torus.pdf}% + \IG{graphs/I1-10:1-grid-hcube.pdf}% + + \IG{graphs/IN-10:1-cluster-line.pdf}% + \IG{graphs/IN-10:1-cluster-torus.pdf}% + \IG{graphs/IN-10:1-cluster-hcube.pdf}% + + \IG{graphs/IN-10:1-grid-line.pdf}% + \IG{graphs/IN-10:1-grid-torus.pdf}% + \IG{graphs/IN-10:1-grid-hcube.pdf}% + + \caption{Integer mode, comp/comm ratio${} = 10:1$.} +\end{figure} +\clearpage + +\begin{figure} + \centering + \IG{graphs/I1-1:1-cluster-line.pdf}% + \IG{graphs/I1-1:1-cluster-torus.pdf}% + \IG{graphs/I1-1:1-cluster-hcube.pdf}% + + \IG{graphs/I1-1:1-grid-line.pdf}% + \IG{graphs/I1-1:1-grid-torus.pdf}% + \IG{graphs/I1-1:1-grid-hcube.pdf}% + + \IG{graphs/IN-1:1-cluster-line.pdf}% + \IG{graphs/IN-1:1-cluster-torus.pdf}% + \IG{graphs/IN-1:1-cluster-hcube.pdf}% + + \IG{graphs/IN-1:1-grid-line.pdf}% + \IG{graphs/IN-1:1-grid-torus.pdf}% + \IG{graphs/IN-1:1-grid-hcube.pdf}% + + \caption{Integer mode, comp/comm ratio${} = 1:1$.} +\end{figure} +\clearpage + +\begin{figure} + \centering + \IG{graphs/I1-1:10-cluster-line.pdf}% + \IG{graphs/I1-1:10-cluster-torus.pdf}% + \IG{graphs/I1-1:10-cluster-hcube.pdf}% + + \IG{graphs/I1-1:10-grid-line.pdf}% + \IG{graphs/I1-1:10-grid-torus.pdf}% + \IG{graphs/I1-1:10-grid-hcube.pdf}% + + \IG{graphs/IN-1:10-cluster-line.pdf}% + \IG{graphs/IN-1:10-cluster-torus.pdf}% + \IG{graphs/IN-1:10-cluster-hcube.pdf}% + + \IG{graphs/IN-1:10-grid-line.pdf}% + \IG{graphs/IN-1:10-grid-torus.pdf}% + \IG{graphs/IN-1:10-grid-hcube.pdf}% + + \caption{Integer mode, comp/comm ratio${} = 1:10$.} +\end{figure} +\clearpage + +\end{document} diff --git a/supercomp11/data/allgraphs.pdf b/supercomp11/data/allgraphs.pdf new file mode 100644 index 0000000..ae2856d Binary files /dev/null and b/supercomp11/data/allgraphs.pdf differ diff --git a/supercomp11/data/genalltex2 b/supercomp11/data/genalltex2 new file mode 100755 index 0000000..c8762c8 --- /dev/null +++ b/supercomp11/data/genalltex2 @@ -0,0 +1,65 @@ +#!/bin/bash + +types=( R I ) +repartitions=( 1 N ) +ratios=( 10:1 1:1 1:10 ) +platforms=( cluster grid ) +topologies=( line torus hcube ) + +cat < wide - x.2 <- reshape(x.1, direction="wide", idvar="Algo", timevar="Size") + ## reshape data -> wide + dset.wide <- reshape(dset.long, direction="wide", + idvar="Algo", timevar="Size") - ## Rename rows - rownames(x.2) <- x.2$Algo - #colnames(x.2) <- sub("^[^.]*\\.", "", colnames(x.2)) + ## rename rows + rownames(dset.wide) <- dset.wide$Algo + #colnames(dset.wide) <- sub("^[^.]*\\.", "", colnames(dset.wide)) - ## Remove first column ("Algo") - x.3 <- as.matrix(x.2[-1]) + ## remove first column (aka "Algo") + dset.mat <- as.matrix(dset.wide[-1]) - x.4 <- x.3[, c(FALSE,FALSE,TRUE)] - barplot(x.4, beside=TRUE, - names.arg=sub("^[^.]*\\.", "", colnames(x.4)), - col=rainbow(nrow(x.3), s=.5)) + dset.plot <- dset.mat[, c(FALSE,FALSE,TRUE)] + barplot(dset.plot, beside=TRUE, + names.arg=sub("^[^.]*\\.", "", colnames(dset.plot)), + col=rainbow(nrow(dset.mat), s=.5)) - x.4 <- x.3[, c(FALSE,TRUE,FALSE)] - barplot(x.4, beside=TRUE, + dset.plot <- dset.mat[, c(FALSE,TRUE,FALSE)] + barplot(dset.plot, beside=TRUE, axes=FALSE, axisnames=FALSE, add=TRUE, legend.text=TRUE, - col=rainbow(nrow(x.3))) + args.legend=list(x="topleft", inset=c(.02,0), title="Algorithms"), + col=rainbow(nrow(dset.mat))) - x.4 <- x.3[, c(TRUE,FALSE,FALSE)] - barplot(x.4, beside=TRUE, + dset.plot <- dset.mat[, c(TRUE,FALSE,FALSE)] + barplot(dset.plot, beside=TRUE, axes=FALSE, axisnames=FALSE, add=TRUE, - col=rainbow(nrow(x.3), v=.5)) + col=rainbow(nrow(dset.mat), v=.5)) ## finally, set titles t <- paste0(dset$Mode[1], dset$Distrib[1], " / ", dset$Ratio[1], " / ", dset$Platform[1], " / ", dset$Topo[1]) - title(xlab="Platform Size", - ylab="Simulated Time (s)", + title(xlab="Platform size", + ylab="Simulated time (s)", main=t) } @@ -148,22 +166,43 @@ msg <- function(text, message(text) } +if (FALSE) { msg("First test, with algorithms \"plain\"...", wait = FALSE); -xx <- draw(subset(ds, grepl("[lt]_plain", Algo)), - draw_distrib="N") +draw(subset(ds, grepl("[lt]_plain", Algo)), draw_distrib="N") msg("... with draw2()...") -draw2(xx) +draw2(subset(ds, grepl("[lt]_plain", Algo)), draw_distrib="N") msg("Second test, with algorithms \"bookkeeping\"..."); -xx <- draw(subset(ds, grepl("[lt]_bookkeeping", Algo)), - draw_distrib="N") +draw(subset(ds, grepl("[lt]_bookkeeping", Algo)), draw_distrib="N") msg("... with draw2()...") -draw2(xx) +draw2(subset(ds, grepl("[lt]_bookkeeping", Algo)), draw_distrib="N") msg("Third test, with all algorithms..."); -xx <- draw(draw_distrib="N") +draw(draw_distrib="N") msg("... with draw2()...") -draw2(xx) +draw2(draw_distrib="N") +} + +system("mkdir -pv graphs") +for (m in c("R", "I")) { + for (d in c("1", "N")) { + for (r in c("10:1", "1:1", "1:10")) { + for (t in c("line", "torus", "hcube")) { + for (p in c("grid", "cluster")) { + message(sprintf(">>> Drawing: %s%s / %s / %s / %s", m, d, r, p, t)) + pdf(file=sprintf("graphs/%s%s-%s-%s-%s.pdf", m, d, r, p, t)) + draw2(#subset(ds, grepl("[lt]_plain", Algo)), + draw_mode=m, draw_distrib=d, draw_ratio=r, + draw_topo=t, draw_platform=p) + dev.off() + } + } + } + } +} + +## restore default options +options(scipen=osp) diff --git a/supercomp11/data/split-allgraphs b/supercomp11/data/split-allgraphs new file mode 100755 index 0000000..b414175 --- /dev/null +++ b/supercomp11/data/split-allgraphs @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +make allgraphs.pdf + +mkdir -vp graphs +cd graphs + +echo "Separate pages..." +pdfseparate ../allgraphs.pdf g-%d.pdf || true + +for f in g-[0-9]*.pdf; do + n=$(pdftotext $f - | sed '\,/,!d;s, / ,-,g').pdf + mv -v $f $n +done