source: palm/trunk/TUTORIAL/SOURCE/runs_with_mrun.tex @ 982

Last change on this file since 982 was 973, checked in by maronga, 12 years ago

tutorial updates

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 38.6 KB
Line 
1% $Id: runs_with_mrun.tex 973 2012-08-07 16:03:47Z maronga $
2\input{header_tmp.tex}
3%\input{../header_lectures.tex}
4
5\usepackage[utf8]{inputenc}
6\usepackage{ngerman}
7\usepackage{pgf}
8\usetheme{Dresden}
9\usepackage{subfigure}
10\usepackage{units}
11\usepackage{multimedia}
12\usepackage{hyperref}
13\newcommand{\event}[1]{\newcommand{\eventname}{#1}}
14\usepackage{xmpmulti}
15\usepackage{tikz}
16\usetikzlibrary{shapes,arrows,positioning}
17\def\Tiny{\fontsize{4pt}{4pt}\selectfont}
18\usepackage{amsmath}
19\usepackage{amssymb}
20\usepackage{multicol}
21\usepackage{pdfcomment}
22\usepackage{graphicx}
23\usepackage{listings}
24\lstset{showspaces=false,language=fortran,basicstyle=
25        \ttfamily,showstringspaces=false,captionpos=b}
26
27\institute{Institut fÌr Meteorologie und Klimatologie, Leibniz UniversitÀt Hannover}
28\date{last update: \today}
29\event{PALM Seminar}
30\setbeamertemplate{navigation symbols}{}
31
32\setbeamertemplate{footline}
33  {
34    \begin{beamercolorbox}[rightskip=-0.1cm]&
35     {\includegraphics[height=0.65cm]{imuk_logo.pdf}\hfill \includegraphics[height=0.65cm]{luh_logo.pdf}}
36    \end{beamercolorbox}
37    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,
38      leftskip=.3cm,rightskip=0.3cm plus1fil]{title in head/foot}
39      {\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor} \hfill \eventname \hfill \insertframenumber \; / \inserttotalframenumber}
40    \end{beamercolorbox}
41    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
42    \end{beamercolorbox}
43  }
44
45%\logo{\includegraphics[width=0.3\textwidth]{luhimuk_logo.pdf}}
46
47\title[Carrying out runs using mrun]{Carrying out runs using \texttt{mrun}}
48\author{Siegfried Raasch}
49
50\begin{document}
51
52% Folie 1
53\begin{frame}
54\titlepage
55\end{frame}
56
57\section{Carrying out runs using mrun}
58\subsection{Carrying out runs using mrun}
59
60% Folie 2
61\begin{frame}
62   \frametitle{What is \texttt{mrun}?}
63   \begin{itemize}
64      \item<1-> \texttt{mrun} (\textbf{m}odel \textbf{run}) is a shell script (using
65      \texttt{ksh}-syntax) which can be used to compile and run programs, including
66      the handling of input/output files.
67      \vspace{4mm}
68      \item<2-> The \texttt{mrun}-command has a number of options to control the
69      program execution\\
70         \quad \footnotesize \texttt{mrun -d example\underline{ }cbl -h lcsgih -K parallel -X8 -T2 ...}\\
71         \normalsize All options including a short description can be displayed by entering\\
72         \quad \footnotesize \texttt{mrun ?}
73      \vspace{4mm}
74      \item<3-> \normalsize The shellscript execution is also controlled by a configuration file with default name \texttt{.mrun.config} 
75   \end{itemize}
76\end{frame}
77
78% Folie 3
79\begin{frame}
80   \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.1\textwidth, font=\tiny]
81   \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.22\textwidth, font=\tiny]
82   \tikzstyle{info} = [rectangle, text width=0.15\textwidth, font=\tiny]
83   \tikzstyle{white} = [rectangle, text width=0.7\textwidth, font=\tiny]
84   \tikzstyle{dummy} = [rectangle, text width=0.3\textwidth, font=\tiny]
85   \tikzstyle{line} = [draw, -]
86   \tikzstyle{alert} = [rectangle, draw, text width=0.77\textwidth, font=\scriptsize]
87 
88   \scriptsize
89   \frametitle{Carrying Out Runs Using \texttt{mrun}}
90   \textbf{Carrying out a program run typically needs two steps:}\\
91   \vspace{1mm}
92   \quad 1. compilation\\
93   \qquad \texttt{f90  ...  file1.f90 file2.f90 ...}\\
94   \vspace{1mm}
95   \onslide<2->\quad 2. execution\\
96   \qquad \texttt{a.out}\\
97   \vspace{3mm}
98   \onslide<3->\textbf{Besides, a program needs input data and creates output data:}\\
99   
100   \onslide<4->\begin{tikzpicture}[auto, node distance=0]
101      \node [green] (first) {\textbf{a.out/} };
102      \node [dummy, right=0.1cm of first] (second) {};
103     
104      \node [yellow, above=0.4cm of second] (third) {\textbf{parameter for steering}};
105      \node [yellow, below=0.4cm of third] (fourth) {\textbf{control output}};
106      \node [yellow, below=0.3cm of fourth] (fifth) {\textbf{output for analysis}};
107     
108      \node [info, above=-0.1cm of third] (sixth) {input file};
109      \node [info, above=-0.1cm of fourth] (seventh) {output file 1};
110      \node [info, above=-0.1cm of fifth] (eight) {output file 2};
111
112      \draw [->] (third.west) -- (first.north);
113      \draw [->] (first.east) -- (fourth.west);
114      \draw [->] (first.south) -- (fifth.west);
115     
116      \uncover<5->{\node [white, right=0.25cm of third] (ninth) {
117         \texttt{OPEN (11, FILE='PARIN', FORM='FORMATTED')}};}
118      \uncover<5->{\node [white, right=0.25cm of fourth] (tenth) {
119         \texttt{OPEN (15, FILE='RUN\underline{ }CONTROL', FORM='FORMATTED')}};}
120      \uncover<5->{\node [white, right=0.25cm of fifth] (eleventh) {
121         \texttt{OPEN (40, FILE=‘DATA\underline{ }1D\underline{ }PR\underline{ }NETCDF', FORM='FORMATTED')}};}
122   \end{tikzpicture}
123   
124   \vspace{3mm}
125   \scriptsize
126   \onslide<6->\textcolor{red}{\textbf{Problems:} The user has to copy or rename output files, if
127   he/she wants to run the program more than once and if he concurrently wants to keep
128   the files from the former run(s). If he/she is using different input parameter files for steering, these files also have
129   to be copied into the working directory before the program is executed.}\\
130   \vspace{1mm}
131   \begin{tikzpicture}[auto, node distance=0]
132      \uncover<7->{\node [alert] (alert) {\textcolor{red}{\textbf{It is therefore very desirable to automate these tasks!}}};}
133   \end{tikzpicture}
134\end{frame}
135
136% Folie 4
137\begin{frame}
138   \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.45\textwidth, font=\scriptsize]
139   \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize]
140   \tikzstyle{yellowsmall} = [rectangle, draw, fill=yellow!20, text width=0.10\textwidth, font=\scriptsize]
141   \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\tiny]
142   
143   \frametitle{\texttt{mrun}: Principal Mode of Operation (I)}
144   \scriptsize \texttt{mrun} \textbf{runs a program (in our case the PALM model) by carrying out the following principle tasks in a sequential order:}\\
145   \vspace{1mm}
146   \begin{enumerate}
147      \item<2-> Create a temporary working directory and change into this directory:\\
148      \quad \texttt{mkdir <tempdir>/<username>.<randomnumber>}\\
149      \quad \texttt{cd <tempdir>/<username>.<randomnumber>}\\
150      \ \\
151      The path of \texttt{<tempdir>} is given in the configuration file
152      \texttt{.mrun.config} by the environment variable \texttt{tmp\underline{ }user\underline{ }catalog}, e.g.:\\
153           \quad \texttt{\%tmp\underline{ }user\underline{ }catalog  /tmp \hspace{30mm} <hi>  parallel}\\
154           \ \\
155           \onslide<3-> On SGI-ICE: \\
156           \quad \texttt{\%tmp\underline{ }user\underline{ }catalog  /gfs2/work/<username>
157           \hspace{5mm} lcsgih parallel}
158           \begin{center}
159              \begin{tikzpicture}[auto, node distance=0]
160            \uncover<4->{\node [green] (green) {/tmp/$<$username$>$.$<$randomnumber$>$};}
161         \end{tikzpicture}
162           \end{center}
163           \vspace{2mm}
164           \item<5-> Copy the input files from a directory of the user into this working directory:\\
165           \vspace{1mm}
166           \onslide<6-> \tiny \quad \texttt{cp <user\underline{ }input\underline{ }file1>
167           /tmp/<username>.<randomnumber>/<temporary\underline{ }input\underline{ }file1>}\\
168      \quad \texttt{cp <user\underline{ }input\underline{ }file2>
169      /tmp/<username>.<randomnumber>/<temporary\underline{ }input\underline{ }file2>}\\
170      \vspace{2mm}
171      \scriptsize
172      \begin{center}
173              \begin{tikzpicture}[auto, node distance=0]
174             
175            \uncover<8->{\node [green] (green) {/tmp/$<$username$>$.$<$randomnumber$>$};}
176       
177            \uncover<7->{\node [yellowsmall, above=0.1cm of green] (yellow2) {JOBS/};}
178            \uncover<7->{\node [yellow, left=0.2cm of yellow2] (yellow1) {current\underline{ }version/};}
179            \uncover<7->{\node [yellow, right=0.2cm of yellow2] (yellow3) {example\underline{ }cbl/};}
180            \uncover<7->{\node [yellowsmall, right=0.2cm of yellow3] (yellow4) {INPUT/};}
181           
182            \draw<7-> [-] (yellow1.east) -- (yellow2.west);
183            \draw<7-> [-] (yellow2.east) -- (yellow3.west);
184            \draw<7-> [-] (yellow3.east) -- (yellow4.west);
185           
186            \node [dummy, right=0.1cm of yellow4] (dummy1) {};
187            \node [dummy, right=2.055cm of green] (dummy2) {};
188           
189            \draw<9-> [-] (yellow4.east) -- (dummy1.center);
190            \draw<9-> [-] (dummy1.center) -- (dummy2.center);
191            \draw<9-> [->] (dummy2.center) -- (green.east);
192           
193         \end{tikzpicture}
194           \end{center}
195     
196        \end{enumerate}
197
198\end{frame}
199
200% Folie 5
201\begin{frame}
202   \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.45\textwidth, font=\scriptsize, minimum height=0.6cm]
203   \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize, minimum height=0.6cm]
204   \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\scriptsize, minimum height=0.6cm]
205   
206   \frametitle{\texttt{mrun}: Principal Mode of Operation (II)}
207
208        \begin{enumerate}
209      \setcounter{enumi}{2}
210           \item<1-> Copy the pre-compiled routines to the temporary working directory:\\
211     
212      \begin{center}
213              \begin{tikzpicture}[auto, node distance=0]
214                 \uncover<2->{\node [yellow] (yellow) {current\underline{ }version/};}
215                 \uncover<1->{\node [dummy, right=0.0cm of yellow] (dummy1) {};}
216                 \uncover<2->{\node [green, right=0.2cm of yellow] (green1) {MAKE\underline{ }DEPOSITORY\underline{ }\textit{parallel}/};}
217                 \uncover<1->{\node [dummy, right=0.2cm of green1] (dummy2) {};}
218            \uncover<3->{\node [green, below=0.5cm of dummy1] (green2) {/tmp/$<$username$>$.$<$randomnumber$>$};}
219             \uncover<1->{\node [dummy, below=0.5cm of dummy2] (dummy3) {};}
220             \uncover<4->{\node [dummy, right=0.0cm of dummy3] (text) {Makefile\\
221                 *.f90\\
222                 *.o\\
223                 ...\\ \ \\};}
224             
225             \draw<2-> [-] (yellow.east) -- (green1.west);
226             \draw<4-> [-] (green1.east) -- (dummy2.center);
227             \draw<4-> [-] (dummy2.center) -- (dummy3.center);
228             \draw<4-> [->] (dummy3.center) -- (green2.east);
229              \end{tikzpicture}
230           \end{center}
231           
232           \item<5-> Compile the main program and use pre-compiled object files:\\
233     \quad \texttt{f90 palm.f90 *.o ...   ( make Makefile)}
234      \item<6-> Execute the program:\\
235     \quad \texttt{a.out}
236   \end{enumerate}
237\end{frame}
238
239% Folie 6
240\begin{frame}
241   \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.45\textwidth, font=\scriptsize, minimum height=0.6cm]
242   \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize, minimum height=0.6cm]
243   \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\scriptsize, minimum height=0.6cm]
244   
245   \frametitle{\texttt{mrun}: Principal Mode of Operation (III)}
246   \footnotesize 
247        \begin{enumerate}
248      \setcounter{enumi}{5}
249           \item<1-> Copy the output files from the working directory to a (permanent) directory of the user:\\
250       \tiny \quad \texttt{cp /tmp/<username>.<randomnumber>/<temporary\underline{ }output\underline{ }file1> <user\underline{ }output\underline{ }file1>}\\
251      \quad \texttt{cp /tmp/<username>.<randomnumber>/<temporary\underline{ }output\underline{ }file2> <user\underline{ }output\underline{ }file2>}\\
252      \footnotesize 
253      \begin{center}
254              \begin{tikzpicture}[auto, node distance=0]
255            \uncover<2->{\node [yellow] (yellow1) {MONITORING/};}
256
257            \uncover<2->{\node [dummy, right=0.2cm of yellow1] (dummy2) {};}
258            \uncover<2->{\node [dummy, above=0.2cm of dummy2] (dummy1) {};}
259            \uncover<2->{\node [dummy, below=0.2cm of dummy2] (dummy3) {};}
260           
261            \uncover<2->{\node [yellow, left=0.2cm of dummy3] (yellow2) {OUTPUT/};}
262            \uncover<2->{\node [yellow, left=0.2cm of yellow2] (yellow3) {example\underline{ }cbl/};}
263            \uncover<2->{\node [yellow, left=0.2cm of yellow3] (yellow4) {JOBS/};}
264            \uncover<2->{\node [yellow, left=0.2cm of yellow4] (yellow5) {current\underline{ }version/};}
265                                             
266                 \uncover<2-3>{\node [green, left=5.0cm of dummy1] (green) {/tmp/$<$username$>$.$<$randomnumber$>$};}
267                 
268            \draw<2-3> [-] (green.east) -- (dummy1.center);
269            \draw<2-3> [-] (dummy2.center) -- (dummy1.center);
270            \draw<2-3> [-] (dummy3.center) -- (dummy1.center);
271           
272            \draw<2-3> [->] (dummy2.center) -- (yellow1.east);
273            \draw<2-3> [->] (dummy3.center) -- (yellow2.east);
274           
275            \draw<2-> [-] (yellow2.west) -- (yellow3.east);
276            \draw<2-> [-] (yellow3.west) -- (yellow4.east);
277            \draw<2-> [-] (yellow4.west) -- (yellow5.east);
278               
279              \end{tikzpicture}
280           \end{center}
281           
282           \item<3-> Delete the temporary working directory\\
283      \quad \texttt{rm -rf /tmp/<username>.<randomnumber>}\\
284      \vspace{2mm}
285      \onslide<5->\textcolor{red}{Question: How does \texttt{mrun} know which files have to be copied and where from or where to they have to be copied?}
286
287   \end{enumerate}
288\end{frame}
289
290% Folie 7
291\begin{frame}
292   \tikzstyle{small} = [rectangle, text width=0.08\textwidth, font=\scriptsize]
293   \tikzstyle{large} = [rectangle, text width=0.45\textwidth, font=\scriptsize]
294   \tikzstyle{box} = [rectangle, draw, text width=0.2\textwidth, font=\scriptsize]
295   \tikzstyle{boxbig} = [rectangle, draw, text width=0.4\textwidth, font=\scriptsize]
296   \tikzstyle{dummy} = [rectangle, text width=0.0\textwidth, font=\scriptsize, minimum height=0.5cm]
297   
298   \frametitle{Steering File Copy by the Configuration File (I)}
299   \scriptsize
300   \textbf{Copying of files is controlled by so called} \textit{file connection statements}. \textbf{They connect local files in the temporary working directory with permanent files residing in the directory of the user.}\\
301   \vspace{1mm}
302   Principle example of a file connection statement (for the PALM parameter file):
303   \vspace{-3mm}
304   \begin{center}
305           \begin{tikzpicture}[auto, node distance=0]
306         \uncover<1->{\node [small] (part1) {\texttt{PARIN}};}
307         \uncover<1->{\node [dummy, left=-0.2cm of part1] (dummy1) {};}
308         \uncover<1->{\node [dummy, below=1.25cm of dummy1] (dummy3) {};}
309         \uncover<1->{\node [small, right=0.0cm of part1] (part2) {\quad \texttt{in}};}
310         \uncover<1->{\node [dummy, right=0.0cm of part2] (dummy2) {};}
311         \uncover<1->{\node [small, right=0.2cm of part2] (part3) {\texttt{d3\#}};}
312              \uncover<1->{\node [large, right=0.0cm of part3] (part4) {\texttt{\~{}/palm/current\underline{ }version/JOB/INPUT}};}
313              \uncover<1->{\node [small, right=0.0cm of part4] (part5) {\texttt{\underline{ }p3d}};}
314              \uncover<1->{\node [small, right=0.2cm of part5] (part6) {\texttt{( \textcolor{red}{nc} )}};}
315                   
316         \uncover<2->{\node [boxbig, below=1.25cm of dummy2] (box1) {local filename in the working directory (must correspond to the filename in the \texttt{OPEN} statement of the program)};}
317              \draw<2-> [->] (dummy3.north) -- (dummy1.south);
318             
319              \uncover<3->{\node [box, below=0.7cm of part2] (box2) {file attributes};}
320              \draw<3-> [->] (box2.north) -- (part2.south);
321             
322              \uncover<4->{\node [box, below=0.2cm of part3] (box3) {activating string};}
323              \draw<4-> [->] (box3.north) -- (part3.south);
324                     
325              \uncover<5->{\node [box, below=0.2cm of part4] (box4) {directory in which the permanent user file resides};}
326              \draw<5-> [->] (box4.north) -- (part4.south);
327             
328         \uncover<6->{\node [box, below=0.2cm of part5] (box5) {suffix of the permanent filename};}
329              \draw<6-> [->] (box5.north) -- (part5.south);
330             
331         \uncover<7->{\node [box, below=1.0cm of part6] (box6) {additional suffix for netCDF files};}
332              \draw<7-> [->] (box6.north) -- (part6.south);   
333           \end{tikzpicture}
334        \end{center}
335   
336   \onslide<8->The full name of the permanent file results from the directory name, the suffix and the value of \texttt{mrun}-Option \texttt{-d}, which defines the so-called \textbf{base name} of all files handled by \texttt{mrun}:\\
337   \quad \texttt{mrun -d \textcolor{blue}{example\underline{ }cbl} ...}\\
338   gives the filename\\
339   \quad \texttt{\~{}/palm/current\underline{ }version/JOB/INPUT/\textcolor{blue}{example\underline{ }cbl}\underline{ }p3d}\\
340   \quad \texttt{( ... /\textcolor{blue}{example\underline{ }cbl}\underline{ }p3d\textcolor{red}{.nc} )}
341   
342\end{frame}
343
344% Folie 8
345\begin{frame}
346   \frametitle{Steering File Copy by the Configuration File (II)}
347   \scriptsize
348   \onslide<1-> The \textbf{base name} can additionally be a part of the directory name
349   by using \textcolor{blue}{\texttt{\$fname}} in the directory column of the file connection statement:\\
350   \quad \texttt{PARIN in d3\# \~{}/palm/current\underline{ }version/JOBS/\textcolor{blue}{\$fname}/INPUT \underline{ }p3d}\\
351   \ \\
352   \onslide<2-> Using the call\\
353   \quad \texttt{mrun -d \textcolor{blue}{abcde} ...}\\
354   the input file will be expected under\\
355   \quad \texttt{\~{}/palm/current\underline{ }version/JOBS/\textcolor{blue}{abcde}/INPUT/\textcolor{blue}{abcde}\underline{ }p3d }\\
356   \ \\
357   \onslide<3-> In this way, all files handled by the \texttt{mrun}-call are stored in
358   the same subdirectory (\textcolor{blue}{abcde/}) and will have the same string (\texttt{\textcolor{blue}{abcde}}) as
359   part of their names, so they can be easily identified as \grqq belonging\grqq\, to the model
360   run initiated by that \texttt{mrun} call.\\
361   \ \\
362   \onslide<4-> Instead of always writing the full path name (i.e.
363   \texttt{\~{}/palm/current\underline{ }version/JOBS}), an environment variable can be declared for
364   this at the beginning of the configuration file and be used in the file
365   connection statements:\\
366   \quad \texttt{\%base\underline{ }data  \~{}/palm/current\underline{ }version/JOBS}\\
367   \quad \texttt{PARIN in d3\#  \textcolor{blue}{\$base\underline{ }data}/\textcolor{blue}{\$fname}/INPUT \underline{ }p3d}\\
368   \ \\
369   \onslide<5-> This easily allows to change the directories for all input/output files
370   by just changing the value of \texttt{base\underline{ }data}.
371   
372\end{frame}
373
374% Folie 9
375\begin{frame}
376   \frametitle{Steering File Copy by the Configuration File (III)}
377   \scriptsize
378   \onslide<1-> File connection statements which shall be carried out,
379   have to be activated by giving their activation string in the
380   \texttt{mrun}-option \texttt{-r}:\\
381   \quad \texttt{PARIN in d3\# \~{}/palm/current\underline{ }version/JOBS/\$fname/INPUT \underline{ }p3d}\\
382   \ \\
383   \onslide<2-> The permanent file
384   \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/INPUT/example\underline{ }cbl\underline{ }p3d} 
385   will only be copied to the local file PARIN by using the call:\\
386   \quad \texttt{mrun -d example\underline{ }cbl -r \dq d3\#\dq\, ...}\\
387   \ \\
388   \onslide<3-> \textbf{Example for an output file:}\\
389   The file connection statement\\
390   \quad \texttt{DATA\underline{ }1D\underline{ }PR\underline{ }NETCDF out:loc pr\# 
391   \~{}/palm/current\underline{ }version/JOBS/\$fname/OUTPUT \underline{ }pr nc}\\
392   \onslide<4-> will copy (after program execution) the local file
393   \texttt{DATA\underline{ }1D\underline{ }PR\underline{ }NETCDF} to the permanent file
394   \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/example\underline{ }cbl\underline{ }pr.nc} if
395   \texttt{mrun} is called with the options\\
396   \quad \texttt{mrun -d example\underline{ }cbl -r \dq d3\# pr\#\dq\, ...}
397   
398\end{frame}
399
400% Folie 10
401\begin{frame}
402   \frametitle{Steering File Copy by the Configuration File (IV)}
403   \scriptsize
404   \onslide<1-> \texttt{mrun} never replaces/overwrites existing files!\\
405   \ \\
406   Instead, new, so-called file cycles are created.\\
407   If an output file, e.g.\\
408   \quad \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/MONITORING/example\underline{ }cbl\underline{ }rc}\\
409   \ \\
410   has been created from a first call of \texttt{mrun} and if the same \texttt{mrun} 
411   call is submitted again, the second call will not replace the file
412   \texttt{example\underline{ }cbl\underline{ }rc}, but will create a new file with name:\\
413   \quad \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/MONITORING/example\underline{ }cbl\underline{ }rc.1}\\
414   \ \\
415   \onslide<2->In case of netCDF-files, the file cycle number is inserted before
416   the netCDF-suffix .nc, e.g.\\
417   \quad \texttt{example\underline{ }cbl\underline{ }pr.1.nc}\\
418   \ \\
419   \onslide<3->The implemented file cycle mechanism does not allow to use
420   any other dots "'."'  in the path or filename:\\
421   \quad \texttt{\~{}/palm/version\underline{ }3.6/JOBS/example.sbl/MONITORING/example.sbl\underline{ }rc}
422\end{frame}
423
424% Folie 11
425\begin{frame}[fragile]
426   \frametitle{\normalsize File Connection Statements From the Default \texttt{.mrun.config} file}
427   \begin{columns}
428      \column{1.1\textwidth}
429      \tiny
430      \begin{lstlisting}
431#----------------------------------------------------------------------------
432# List of input-files
433#----------------------------------------------------------------------------
434PARIN                    in:job        d3#      $base_data/$fname/INPUT    _p3d
435PARIN                    in:job        d3f      $base_data/$fname/INPUT    _p3df
436TOPOGRAPHY_DATA          in:locopt     d3#:d3f  $base_data/$fname/INPUT    _topo
437BININ                    in:loc:flpe   d3f      $base_data/$fname/RESTART  _d3d
438PARTICLE_RESTART_DATA_IN in:loc:flpe   prtf     $base_data/$fname/RESTART  _rprt
439DATA_1D_PR_NETCDF        in:locopt     prf      $base_data/$fname/OUTPUT   _pr     nc
440DATA_1D_SP_NETCDF        in:locopt     spf      $base_data/$fname/OUTPUT   _sp     nc
441DATA_1D_TS_NETCDF        in:locopt     tsf      $base_data/$fname/OUTPUT   _ts     nc
442DATA_1D_PTS_NETCDF       in:locopt     ptsf     $base_data/$fname/OUTPUT   _pts    nc
443DATA_2D_XY_NETCDF        in:locopt     xyf      $base_data/$fname/OUTPUT   _xy     nc
444DATA_2D_XY_AV_NETCDF     in:locopt     xyf      $base_data/$fname/OUTPUT   _xy_av  nc
445DATA_2D_XZ_NETCDF        in:locopt     xzf      $base_data/$fname/OUTPUT   _xz     nc
446DATA_2D_YZ_NETCDF        in:locopt     yzf      $base_data/$fname/OUTPUT   _yz     nc
447DATA_3D_NETCDF           in:locopt     3df      $base_data/$fname/OUTPUT   _3d     nc
448DATA_PRT_NETCDF          in:locopt:pe  prtf     $base_data/$fname/OUTPUT   _prt
449#
450#----------------------------------------------------------------------------
451# List of output-files
452#----------------------------------------------------------------------------
453BINOUT                    out:loc:flpe restart   $base_data/$fname/RESTART  _d3d
454PARTICLE_RESTART_DATA_OUT out:loc:flpe prt#:prtf $base_data/$fname/RESTART  _rprt
455#
456RUN_CONTROL       out:loc:tr   d3#     $base_data/$fname/MONITORING  _rc
457RUN_CONTROL       out:loc:tra  d3f     $base_data/$fname/MONITORING  _rc
458HEADER            out:loc:tr   d3#     $base_data/$fname/MONITORING  _header
459HEADER            out:loc:tra  d3f     $base_data/$fname/MONITORING  _header
460CPU_MEASURES      out:loc:tr   d3#     $base_data/$fname/MONITORING  _cpu
461CPU_MEASURES      out:loc:tra  d3f     $base_data/$fname/MONITORING  _cpu
462#
463DATA_1D_PR_NETCDF    out:loc:tr   pr#:prf   $base_data/$fname/OUTPUT  _pr     nc
464DATA_1D_SP_NETCDF    out:loc:tr   sp#:spf   $base_data/$fname/OUTPUT  _sp     nc
465DATA_1D_TS_NETCDF    out:loc:tr   ts#:tsf   $base_data/$fname/OUTPUT  _ts     nc
466DATA_1D_PTS_NETCDF   out:loc:tr   pts#:ptsf $base_data/$fname/OUTPUT  _pts    nc
467DATA_2D_XY_NETCDF    out:loc:tr   xy#:xyf   $base_data/$fname/OUTPUT  _xy     nc
468DATA_2D_XY_AV_NETCDF out:loc:tr   xy#:xyf   $base_data/$fname/OUTPUT  _xy_av  nc
469DATA_2D_XZ_NETCDF    out:loc:tr   xz#:xzf   $base_data/$fname/OUTPUT  _xz     nc
470DATA_2D_XZ_AV_NETCDF out:loc:tr   xz#:xzf   $base_data/$fname/OUTPUT  _xz_av  nc
471DATA_2D_YZ_NETCDF    out:loc:tr   yz#:yzf   $base_data/$fname/OUTPUT  _yz     nc
472DATA_2D_YZ_AV_NETCDF out:loc:tr   yz#:yzf   $base_data/$fname/OUTPUT  _yz_av  nc
473DATA_3D_NETCDF       out:loc:tr   3d#:3df   $base_data/$fname/OUTPUT  _3d     nc
474DATA_3D_AV_NETCDF    out:loc:tr   3d#:3df   $base_data/$fname/OUTPUT  _3d_av  nc
475DATA_MASK_01_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m01     nc
476DATA_MASK_01_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m01_av  nc
477DATA_MASK_02_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m02     nc
478DATA_MASK_02_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m02_av  nc
479DATA_MASK_03_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m03     nc
480DATA_MASK_03_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m03_av  nc
481DATA_MASK_04_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m04     nc
482DATA_MASK_04_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m04_av  nc
483DATA_MASK_05_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m05     nc
484DATA_MASK_05_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m05_av  nc
485DATA_MASK_06_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m06     nc
486DATA_MASK_06_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m06_av  nc
487DATA_MASK_07_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m07     nc
488DATA_MASK_07_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m07_av  nc
489DATA_MASK_08_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m08     nc
490DATA_MASK_08_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m08_av  nc
491DATA_MASK_09_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m09     nc
492DATA_MASK_09_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m09_av  nc
493DATA_MASK_10_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m10     nc
494DATA_MASK_10_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m10_av  nc
495DATA_MASK_11_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m11     nc
496DATA_MASK_11_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m11_av  nc
497DATA_MASK_12_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m12     nc
498DATA_MASK_12_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m12_av  nc
499DATA_MASK_13_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m13     nc
500DATA_MASK_13_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m13_av  nc
501DATA_MASK_14_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m14     nc
502DATA_MASK_14_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m14_av  nc
503DATA_MASK_15_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m15     nc
504DATA_MASK_15_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m15_av  nc
505DATA_MASK_16_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m16     nc
506DATA_MASK_16_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m16_av  nc
507DATA_MASK_17_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m17     nc
508DATA_MASK_17_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m17_av  nc
509DATA_MASK_18_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m18     nc
510DATA_MASK_18_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m18_av  nc
511DATA_MASK_19_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m19     nc
512DATA_MASK_19_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m19_av  nc
513DATA_MASK_20_NETCDF    out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m20     nc
514DATA_MASK_20_AV_NETCDF out:loc:tr ma#:maf   $base_data/$fname/OUTPUT  _m20_av  nc
515DATA_PRT_NETCDF      out:loc:trpe prt#:prtf $base_data/$fname/OUTPUT  _prt    nc
516DATA_DVR             out:loc:trpe dvr       $base_data/$fname/OUTPUT  _dvr
517#
518DVRP_LOG          out:loc:tr   dv#       $base_data/$fname/MONITORING  _dvrp_log
519DVRP_LOG          out:loc:tra  dvf       $base_data/$fname/MONITORING  _dvrp_log
520PARTICLE_INFO     out:loc:tr   pt#       $base_data/$fname/MONITORING  _prt_info
521PARTICLE_INFO     out:loc:tra  ptf       $base_data/$fname/MONITORING  _prt_info
522PARTICLE_DATA     out:loc:flpe prt#:prtf $base_data/$fname/OUTPUT      _prt_dat
523
524      \end{lstlisting}
525   \end{columns}
526\end{frame}
527
528% Folie 12
529\begin{frame}
530   \frametitle{Additional Features of \texttt{mrun}}
531   \begin{itemize}
532      \footnotesize
533      \item<1-> Generating batch jobs on local \textbf{and} remote host.
534      \item<2-> Setting of unix environment variables for job and model control (e.g. for determining compiler options, etc.).
535      \item<3-> Values have to be set in the \texttt{mrun} configuration file \texttt{.mrun.config}:
536   \end{itemize}
537   \onslide<4->\hspace{-1cm}\includegraphics[scale=0.3]{mrun_figures/add_feat1.png}
538   \begin{itemize}
539      \footnotesize
540      \item<5-> User-defined unix commands are carried out before or after execution of the model (input/output commands) or in case of errors during the compile- or run-step (error commands).
541      These commands can also be defined in the \texttt{mrun} configuration file:
542      \onslide<6-> \includegraphics[scale=0.3]{mrun_figures/add_feat2.png}
543      \item<7-> Automatic generation of restart jobs.
544   \end{itemize}
545\end{frame}
546
547% Folie 13
548\begin{frame}
549   \frametitle{PALM \textit{Interactive} Example Run Using \texttt{mrun}: Tracing the Run by the User}
550   \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.35\textwidth, font=\tiny, minimum height=0.6cm]
551   \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.35\textwidth, font=\tiny, minimum height=0.6cm]
552   \tikzstyle{yellow_big} = [rectangle, draw, fill=yellow!20, text width=0.55\textwidth, font=\tiny, minimum height=0.6cm]
553   \tikzstyle{notes} = [rectangle, text width=0.26\textwidth, font=\tiny, minimum height=0.6cm]
554   \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\tiny, minimum height=0.6cm]
555   \vspace{-1.0cm}
556   \begin{center}
557           \begin{tikzpicture}[auto, node distance=0]
558         \uncover<1->{\node [yellow] (box1) {\textbf{start run on local machine:}\\
559                                            \texttt{mrun -d example\underline{ }cbl -h lcmuk ...}};}
560         \uncover<1->{\node [dummy, right=1.4cm of box1] (dummy1) {};}
561         \uncover<2->{\node [notes, above=-0.3cm of dummy1] (notes1) {temporary working directory is created, all required files are copied there};}
562         \uncover<3->{\node [green, right=1.4cm of dummy1] (box2) {\textbf{follow run messages on terminal}};}
563         \uncover<4->{\node [green, below=0.5cm of box2] (box3) {
564         \textbf{as soon as message}
565         
566         \texttt{*** execution starts in directory\\ \quad \dq <tempdir>\dq\, }\\
567         \ \\
568         \textbf{you can change to this directory (in a new terminal) and watch the progess of timesteps}
569
570         \texttt{cd <tempdir>}\\
571         \texttt{tail -f RUN\underline{ }CONTROL}\\
572         \ \\
573         However, this might be difficult in case of short run times, because the run may have finished before you have entered the commands!
574         };}
575         \coordinate[below=0.3cm of box3] (A);
576         \uncover<1->{\node [dummy, left=0.3cm of box3] (dummy2) {};}
577         \uncover<5->{\node [notes, below=0.0cm of A, text width=0.35\textwidth] (notes2) {results are copied from temporary working directory to the user‘s permanent directory};}
578         \uncover<6->{\node [yellow_big, left=2.5cm of A] (box4) {
579         \textbf{check, if the output files have sucessfully been transferred to the permanent directory:}\\
580         \texttt{cd \~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/MONITORING}\\
581         \texttt{ls -al}\\
582         \texttt{cd \~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT}\\
583         \texttt{ls -al}
584};}
585         \draw<2-> [->,color=blue] (box1.east) -- (box2.west);   
586         \draw<4-> [->,color=blue] (box2.south) -- (box3.north); 
587         \draw<5-> [-,color=blue] (box3.south) -- (A); 
588         \draw<5-> [->,color=blue] (A) -- (box4.east);   
589           \end{tikzpicture}
590        \end{center}
591\end{frame}
592
593% Folie 14
594\begin{frame}
595   \frametitle{PALM \textit{Batch} Example Run (on HLRN, remote) Using \texttt{mrun}: Tracing the Run by the User}
596\tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.3\textwidth, font=\Tiny]
597\tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.4\textwidth, font=\Tiny]
598\tikzstyle{dummy} = [text width=0.2\textwidth, font=\Tiny]
599\tikzstyle{alert} = [rectangle, draw, text width=0.5\textwidth, font=\scriptsize]
600\tikzstyle{line} = [draw, -latex']
601\begin{itemize}
602   \item Reminder: Running batch jobs requires a directory \texttt{~/job\underline{ }queue} for the job protocol files on the local \underline{and} remote host.
603\end{itemize}
604\begin{tikzpicture}[auto, node distance=0]
605    \node [yellow] (first) {
606       \textbf{start job on local machine:}\\
607       \texttt{mrun -d example\underline{ }cbl -h lcsgih ...}
608    };
609\uncover<2->{
610    \node [dummy, right=0.5cm of first] (dummy) {
611       transfer of job by \texttt{scp} \\
612       \ \\
613       \ \\
614       submit of job by executing the \texttt{msub} command via \texttt{ssh}
615    };
616}
617\uncover<3->{
618    \node [green, right=3.5cm of first] (second) {
619       \textbf{follow job execution on remote host, by} \\
620       \texttt{showq} (better: \texttt{showq | grep hzkurs})
621    };
622}
623\uncover<4->{
624    \node [green, below=0.2cm of second] (third) {
625       \textbf{if job is running, you may follow its progress by watching the job protocol:} \\ 
626       \texttt{cd \~/job\underline{ }queue \\ tail lcmuk\underline{ }example\underline{ }cbl}
627    };
628}
629\uncover<5->{
630    \node [green, below=0.2cm of third] (fourth) {
631       \textbf{when job is running, change to directory \texttt{<tmp\underline{ }usr\underline{ }catalog>} and try to find there the latest directory \texttt{<HLRN-username>.<randomnumber>} \\ change to this directory and execute}\\
632       \texttt{tail -f RUN\underline{ }CONTROL}
633    };
634}
635\uncover<6->{
636    \node [green, below=0.2cm of fourth] (fifth) {
637       \textbf{when the job is finished, watch, if the job protocol is transferred to the local host without errors:}\\
638       \texttt{cd \~/job\underline{ }queue \\ cat last\underline{ }job\underline{ }transfer\underline{ }protocol}
639    };
640}
641\uncover<7->{
642    \node [dummy, left=0.5cm of fifth] (dummy) {
643       transfer results by \texttt{scp} \\
644       \ \\
645       \ \\
646    };
647}
648\uncover<8->{
649    \node [yellow, left=3.5cm of fifth] (sixth) {
650       \textbf{check, if the job protocol and all output files have successfully been transferred to the local machine:}\\
651       \texttt{cd \~/job\underline{ }queue \\ ls -al \\ cd ~/palm/current\underline{ }version/JOBS/example \\ ls -al *}
652    };
653}
654\uncover<9->{
655     \node [alert, below=0.5cm of first.south east] (alert) {
656        \textcolor{red}{Attention: Commands for submitting jobs and the behaviour of job protocol files are depending on the queueing system! Manual adjustments may be required in the mrun and subjob script!}
657     };
658}
659    \path<2-> [line] (first) -- (second);
660    \path<4-> [line] (second) -- (third);
661    \path<5-> [line] (third) -- (fourth);
662    \path<6-> [line] (fourth) -- (fifth);
663    \path<7-> [line] (fifth) -- (sixth);
664\end{tikzpicture}
665\end{frame}
666
667
668
669% Folie 15
670\begin{frame}
671   \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.45\textwidth, font=\scriptsize, minimum height=0.6cm]
672   \tikzstyle{green_small} = [rectangle, draw, fill=green!20, text width=0.12\textwidth, font=\scriptsize, minimum height=0.6cm]
673   \tikzstyle{yellow_small} = [rectangle, draw, fill=yellow!20, text width=0.1\textwidth, font=\scriptsize, minimum height=0.6cm]
674   \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize, minimum height=0.6cm]
675   \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\scriptsize, minimum height=0.6cm]
676   \tikzstyle{notes} = [rectangle, text width=0.15\textwidth, font=\scriptsize, minimum height=0.6cm]
677   
678   \frametitle{PALM Runs Using \texttt{mrun}: Further Details}
679   \begin{itemize}
680      \footnotesize
681      \item<2-> For every (initial) run, \texttt{mrun} creates a source directory which contains copies of
682      \begin{itemize}
683         \footnotesize
684         \item<4-> those source code files to be translated (always the main program, \texttt{palm.f90}, plus user interface files)
685         \item<4-> the Makefile
686         \item<5-> the configuration file
687         \item<6-> the mrun script
688      \end{itemize}
689   \end{itemize}
690   
691   \vspace{-0.8cm}
692   \begin{center}
693           \begin{tikzpicture}[auto, node distance=0]
694           
695         \uncover<3->{\node [yellow_small] (box1) {\$HOME/};}
696         \uncover<3->{\node [yellow_small, right=0.2cm of box1] (box2) {palm/};}
697         \uncover<3->{\node [yellow, right=0.2cm of box2] (box3) {current\underline{ }version/};}
698         \uncover<3->{\node [green_small, right=0.4cm of box3] (box4) {trunk/};}
699         
700         \uncover<1->{\node [dummy, right=1.0cm of box4] (dummy1) {};}
701         
702         \uncover<3->{\node [green_small, above=-0.2cm of dummy1] (box5) {SCRIPTS};}
703         \uncover<3->{\node [green_small, below=-0.2cm of dummy1] (box6) {SOURCE};}
704         
705         \uncover<6->{\node [notes, right=0.1cm of box5] (notes1) {\texttt{mrun}};}
706         \uncover<4->{\node [notes, right=0.1cm of box6] (notes2) {\texttt{Makefile \\ palm.f90}};}
707         \uncover<5->{\node [notes, below=0.1cm of box3] (notes3) {\texttt{.mrun.config}};}
708         
709         \uncover<3->{\node [green, below=0.2cm of box6] (box7) {SOURCES\underline{ }FOR\underline{ }RUN\underline{ }$<$run\underline{ }identifier$>$};}
710         
711         \uncover<1->{\node [dummy, left=1.5cm of box7] (dummy2) {};}
712         \uncover<1->{\node [dummy, right=2.0cm of box5] (dummy3) {};}
713         \uncover<1->{\node [dummy, right=1.8cm of box6] (dummy4) {};}
714         \uncover<1->{\node [dummy, below=0.2cm of dummy4] (dummy5) {};}
715         \draw<3-> [-] (box1.east) -- (box2.west); 
716         \draw<3-> [-] (box2.east) -- (box3.west); 
717         \draw<3-> [-] (box3.east) -- (box4.west); 
718         \draw<3-> [-] (box4.east) -- (box5.west); 
719         \draw<3-> [-] (box4.east) -- (box6.west);     
720         \draw<3-> [-] (box3.east) -- (box7.west);   
721         \draw<6-> [-] ([xshift=-0.8cm]notes1.east) -- (dummy3.center);   
722         \draw<4-> [-] ([xshift=-0.4cm]notes2.east) -- (dummy4.center);
723         \draw<4-> [-] (dummy4.center) -- ([yshift=0.1cm]dummy5.center);
724         \draw<4-> [->] ([yshift=0.1cm]dummy5.center) -- ([yshift=0.1cm]box7.east);
725         \draw<6-> [-] (dummy3.center) -- ([xshift=0.2cm, yshift=-0.1cm]dummy5.center);
726         \draw<6-> [->] ([xshift=0.2cm, yshift=-0.1cm]dummy5.center) -- ([yshift=-0.1cm]box7.east);
727         \draw<5-> [-] ([yshift=0.3cm]dummy2.center) -- (dummy2.center);   
728         \draw<5-> [->] (dummy2.center) -- (box7.west);   
729           \end{tikzpicture}
730        \end{center}
731   
732   \begin{itemize}
733      \footnotesize
734      \item<7-> These files are used in the run/job. They are also used by restart jobs, which guarantees, that all jobs in a job chain are using the same information. Please never modify these directories, unless you exactly know, what you are doing.
735   \end{itemize}
736\end{frame}
737
738\end{document}
Note: See TracBrowser for help on using the repository browser.