source: configs/testing/bash/post.sh @ 1057

Last change on this file since 1057 was 560, checked in by dubos, 7 years ago

testing : fix some issues with auto-generated correctness report

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[518]1#!/bin/bash
[502]2
[510]3function to_latex() {
[560]4echo "$1" | sed 's/_/\\_/g'
[510]5}
6
7function svn_info() {
8    cd $1
9    svn info | grep URL
10    echo '\\'
11    svn info | grep Revision
12    echo '\\'
13}
14
15function abstract()
16{
17    cd $ROOT
18    hostname ; echo '\\'
19    pwd ; echo '\\'
[547]20    ls -l DYNAMICO ; echo '\\'
[510]21    svn_info $ROOT/XIOS
22    svn_info $ROOT/DYNAMICO
23    svn_info $ROOT
24}
25
[502]26function all_results()
27{
28    cd $ROOT/RUNS
29    for TEST in * ; do
[510]30        NAME=$(to_latex $TEST)
[502]31        echo "\subsection{$NAME}"
[547]32        grep Elapsed logs/gcm.log
33        echo
[510]34        for GRAPH in $(ls $TEST/*.png) ; do
[502]35            cat <<EOF
36\begin{figure}
37\centering{}
38\includegraphics[scale=0.5]{$ROOT/RUNS/$GRAPH}
[510]39\caption{$NAME}
[502]40\end{figure}
41EOF
42        done
[510]43        echo '\newpage{}'
[502]44    done
45#    cd $ROOT/tmp
46}
47
48function all_params()
49{
50    cd $ROOT/RUNS
51    for TEST in * ; do
[510]52        NAME=$(to_latex $TEST)
[502]53        cat <<EOF
54\subsection{$NAME}
55\begin{lstlisting}
56$(cat $TEST/run.def)
57\end{lstlisting}
58EOF
59    done
60#    cd $ROOT/tmp
61}
62
63ROOT=$PWD
64
65for dir in $ROOT/RUNS/* ; do
66    cd $dir
67    echo
68    pwd
69    ls -l post.py netcdf
70    python post.py &
71done
72wait
73
74cd $ROOT/tmp
75rm -f *.aux *.log *.toc *.tex
76
77cat <<EOF >report.tex
[510]78\documentclass[10pt,a4paper,english]{article}
[502]79\usepackage{graphicx}
80\usepackage{listings}
[560]81% the line below tries to avoid font issues on Curie
82\usepackage{lmodern}
[502]83\usepackage[T1]{fontenc}
84\usepackage[latin9]{inputenc}
85\usepackage{color}
86\usepackage{babel}
87\usepackage[unicode=true,pdfusetitle,
88 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
89 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=true]
90 {hyperref}
[510]91\usepackage{geometry}
92\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
[502]93
94\begin{document}
95
96\title{DYNAMICO correctness report ($arch)}
[510]97\date{}
[502]98\author{Thomas Dubos}
99\maketitle
[510]100
101\begin{abstract}
[560]102$(to_latex "$(abstract)")
[510]103\end{abstract}
104
[502]105\tableofcontents{}
106\section{Results}
107$(all_results)
[510]108
109\twocolumn
110
[502]111\section{Parameters}
112$(all_params)
113\end{document}
114EOF
115
[510]116pdflatex -interaction=batchmode report.tex
117pdflatex -interaction=batchmode report.tex
[502]118mailx -s "DYNAMICO correctness report " -a report.pdf dubos@lmd.polytechnique.fr </dev/null
Note: See TracBrowser for help on using the repository browser.