% $Id: runs_with_mrun.tex 1515 2015-01-02 11:35:51Z hoffmann $ \input{header_tmp.tex} %\input{../header_lectures.tex} \usepackage[utf8]{inputenc} \usepackage{ngerman} \usepackage{pgf} \usepackage{subfigure} \usepackage{units} \usepackage{multimedia} \usepackage{hyperref} \newcommand{\event}[1]{\newcommand{\eventname}{#1}} \usepackage{xmpmulti} \usepackage{tikz} \usetikzlibrary{shapes,arrows,positioning} \def\Tiny{\fontsize{4pt}{4pt}\selectfont} \usepackage{amsmath} \usepackage{amssymb} \usepackage{multicol} \usepackage{pdfcomment} \usepackage{graphicx} \usepackage{listings} \lstset{showspaces=false,language=fortran,basicstyle= \ttfamily,showstringspaces=false,captionpos=b,aboveskip=0pt,belowskip=0pt} \institute{Institute of Meteorology and Climatology, Leibniz Universität Hannover} \selectlanguage{english} \date{last update: \today} \event{PALM Seminar} \setbeamertemplate{navigation symbols}{} \setbeamertemplate{footline} { \begin{beamercolorbox}[rightskip=-0.1cm]& {\includegraphics[height=0.65cm]{imuk_logo.pdf}\hfill \includegraphics[height=0.65cm]{luh_logo.pdf}} \end{beamercolorbox} \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex, leftskip=.3cm,rightskip=0.3cm plus1fil]{title in head/foot} {\leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor} \hfill \eventname \hfill \insertframenumber \; / \inserttotalframenumber} \end{beamercolorbox} \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot} \end{beamercolorbox} } %\logo{\includegraphics[width=0.3\textwidth]{luhimuk_logo.pdf}} \title[Carrying out runs using mrun]{Carrying out runs using \texttt{mrun}} \author{PALM group} \begin{document} % Folie 1 \begin{frame} \titlepage \end{frame} \section{Carrying out runs using mrun} \subsection{Carrying out runs using mrun} % Folie 2 \begin{frame} \frametitle{What is \texttt{mrun}?} \footnotesize \begin{itemize} \item<1-> \texttt{mrun} (\textbf{m}odel \textbf{run}) is a shell script (using \texttt{bash}/\texttt{ksh}-syntax) which can be used to compile and run programs, including the handling of input/output files. \vspace{3mm} \item<2-> The \texttt{mrun}-command has a number of options to control the program execution\\ \vspace{3mm} \quad \texttt{mrun -d example\underline{ }cbl -h lcsgih -K parallel -X8 -T2 ...}\\ \vspace{3mm} All options including a short description can be displayed by entering\\ \vspace{3mm} \quad \texttt{mrun ?} \vspace{4mm} \item<3-> The shellscript execution is also controlled by a configuration file with default name \texttt{.mrun.config} \end{itemize} \end{frame} % Folie 3 \begin{frame} \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.1\textwidth, font=\tiny] \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.22\textwidth, font=\tiny] \tikzstyle{info} = [rectangle, text width=0.15\textwidth, font=\tiny] \tikzstyle{white} = [rectangle, text width=0.7\textwidth, font=\tiny] \tikzstyle{dummy} = [rectangle, text width=0.3\textwidth, font=\tiny] \tikzstyle{line} = [draw, -] \tikzstyle{alert} = [rectangle, draw, text width=0.77\textwidth, font=\scriptsize] \scriptsize \frametitle{Carrying Out Runs Using \texttt{mrun}} \textbf{Carrying out a program run typically needs two steps:}\\ \vspace{1mm} \quad 1. compilation\\ \qquad \texttt{f95 ... file1.f90 file2.f90 ...}\\ \vspace{1mm} \onslide<2->\quad 2. execution\\ \qquad \texttt{a.out}\\ \vspace{3mm} \onslide<3->\textbf{Besides, a program needs input data and creates output data:}\\ \onslide<4->\begin{tikzpicture}[auto, node distance=0] \node [green] (first) {\textbf{a.out/} }; \node [dummy, right=0.1cm of first] (second) {}; \node [yellow, above=0.4cm of second] (third) {\textbf{parameter for steering}}; \node [yellow, below=0.4cm of third] (fourth) {\textbf{control output}}; \node [yellow, below=0.3cm of fourth] (fifth) {\textbf{output for analysis}}; \node [info, above=-0.1cm of third] (sixth) {input file}; \node [info, above=-0.1cm of fourth] (seventh) {output file 1}; \node [info, above=-0.1cm of fifth] (eight) {output file 2}; \draw [->] (third.west) -- (first.north); \draw [->] (first.east) -- (fourth.west); \draw [->] (first.south) -- (fifth.west); \uncover<5->{\node [white, right=0.25cm of third] (ninth) { \texttt{OPEN (11, FILE='PARIN', FORM='FORMATTED')}};} \uncover<5->{\node [white, right=0.25cm of fourth] (tenth) { \texttt{OPEN (15, FILE='RUN\underline{ }CONTROL', FORM='FORMATTED')}};} \uncover<5->{\node [white, right=0.25cm of fifth] (eleventh) { \texttt{OPEN (40, FILE=‘DATA\underline{ }1D\underline{ }PR\underline{ }NETCDF', FORM='FORMATTED')}};} \end{tikzpicture} \vspace{3mm} \scriptsize \onslide<6->\textcolor{red}{\textbf{Problems:} The user has to copy or rename output files, if he/she wants to run the program more than once and if he concurrently wants to keep the files from the former run(s). If he/she is using different input parameter files for steering, these files also have to be copied into the working directory before the program is executed.}\\ \vspace{1mm} \begin{tikzpicture}[auto, node distance=0] \uncover<7->{\node [alert] (alert) {\textcolor{red}{\textbf{It is therefore very desirable to automate these tasks!}}};} \end{tikzpicture} \end{frame} % Folie 4 \begin{frame} \tikzstyle{green} = [rectangle, draw, fill=green!20, font=\scriptsize] \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize] \tikzstyle{yellowsmall} = [rectangle, draw, fill=yellow!20, text width=0.10\textwidth, font=\scriptsize] \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\tiny] \scriptsize \frametitle{\texttt{mrun}: Principal Mode of Operation (I)} \texttt{mrun} \textbf{runs a program (in our case the PALM model) by carrying out the following principle tasks in a sequential order:}\\ \begin{enumerate} \tiny \item<2-> Create a temporary working directory and change into this directory:\\ \vspace{1.5mm} \scriptsize \quad \texttt{mkdir /.}\\ \quad \texttt{cd /.}\\ \tiny \ \\ The path of \texttt{} is given in the configuration file \texttt{.mrun.config} by the environment variable \texttt{tmp\underline{ }user\underline{ }catalog}, e.g.:\\ \vspace{1.5mm} \scriptsize \quad \texttt{\%tmp\underline{ }user\underline{ }catalog /tmp \hspace{30mm} parallel}\\ \tiny \ \\ \onslide<3-> On Cray-XC30: \\ \vspace{1.5mm} \scriptsize \quad \texttt{\%tmp\underline{ }user\underline{ }catalog /gfs1/work/ \hspace{5mm} lcsgih parallel} \vspace{1mm} \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<4->{\node [green] (green) {/$<$tmpdir$>$/$<$username$>$.$<$randomnumber$>$};} \end{tikzpicture} \end{center} \vspace{2mm} \item<5-> \fontsize{7}{1} Copy the input files from a directory of the user into this working directory:\\ \vspace{1mm} \onslide<6-> \tiny \quad \texttt{cp //./}\\ \quad \texttt{cp //./}\\ \vspace{2mm} \scriptsize \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<8->{\node [green] (green) {/$<$tmpdir$>$/$<$username$>$.$<$randomnumber$>$};} \uncover<7->{\node [yellowsmall, above=0.1cm of green] (yellow2) {JOBS/};} \uncover<7->{\node [yellow, left=0.2cm of yellow2] (yellow1) {current\underline{ }version/};} \uncover<7->{\node [yellow, right=0.2cm of yellow2] (yellow3) {example\underline{ }cbl/};} \uncover<7->{\node [yellowsmall, right=0.2cm of yellow3] (yellow4) {INPUT/};} \draw<7-> [-] (yellow1.east) -- (yellow2.west); \draw<7-> [-] (yellow2.east) -- (yellow3.west); \draw<7-> [-] (yellow3.east) -- (yellow4.west); \node [dummy, right=0.06cm of yellow4] (dummy1) {}; \node [dummy, below=0.38cm of dummy1] (dummy2) {}; \draw<9-> [-] (yellow4.east) -- (dummy1.center); \draw<9-> [-] (dummy1.center) -- (dummy2.center); \draw<9-> [->] (dummy2.center) -- (green.east); \end{tikzpicture} \end{center} \end{enumerate} \end{frame} % Folie 5 \begin{frame} \tikzstyle{green} = [rectangle, draw, fill=green!20, font=\scriptsize, minimum height=0.6cm] \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\scriptsize, minimum height=0.6cm] \frametitle{\texttt{mrun}: Principal Mode of Operation (II)} \begin{enumerate} \setcounter{enumi}{2} \item<1-> Copy the pre-compiled routines to the temporary working directory:\\ \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<2->{\node [yellow] (yellow) {current\underline{ }version/};} \uncover<1->{\node [dummy, right=0.0cm of yellow] (dummy1) {};} \uncover<2->{\node [green, right=0.2cm of yellow] (green1) {MAKE\underline{ }DEPOSITORY\underline{ }\textit{parallel}/};} \uncover<1->{\node [dummy, right=0.2cm of green1] (dummy2) {};} \uncover<3->{\node [green, below=0.5cm of dummy1] (green2) {/$<$tmpdir$>$/$<$username$>$.$<$randomnumber$>$};} \uncover<1->{\node [dummy, below=0.5cm of dummy2] (dummy3) {};} \uncover<4->{\node [dummy, right=0.0cm of dummy3] (text) {Makefile\\ *.f90\\ *.o\\ ...\\ \ \\};} \draw<2-> [-] (yellow.east) -- (green1.west); \draw<4-> [-] (green1.east) -- (dummy2.center); \draw<4-> [-] (dummy2.center) -- (dummy3.center); \draw<4-> [->] (dummy3.center) -- (green2.east); \end{tikzpicture} \end{center} \item<5-> Compile the main program and use pre-compiled object files:\\ \quad \texttt{f95 palm.f90 *.o ... ( make Makefile)} \item<6-> Execute the program:\\ \quad \texttt{a.out} \end{enumerate} \end{frame} % Folie 6 \begin{frame} \tikzstyle{green} = [rectangle, draw, fill=green!20, font=\scriptsize, minimum height=0.6cm] \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.2\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\scriptsize, minimum height=0.6cm] \frametitle{\texttt{mrun}: Principal Mode of Operation (III)} \footnotesize \begin{enumerate} \setcounter{enumi}{5} \item<1-> Copy the output files from the working directory to a (permanent) directory of the user:\\ \vspace{1mm} \tiny \quad \texttt{cp //./ }\\ \quad \texttt{cp //./ }\\ \footnotesize \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<2->{\node [yellow] (yellow1) {MONITORING/ };} \uncover<2->{\node [dummy, right=0.2cm of yellow1] (dummy2) {};} \uncover<2->{\node [dummy, above=0.2cm of dummy2] (dummy1) {};} \uncover<2->{\node [dummy, below=0.2cm of dummy2] (dummy3) {};} \uncover<2->{\node [yellow, left=0.2cm of dummy3] (yellow2) {OUTPUT/};} \uncover<2->{\node [yellow, left=0.2cm of yellow2] (yellow3) {example\underline{ }cbl/};} \uncover<2->{\node [yellow, left=0.2cm of yellow3] (yellow4) {JOBS/};} \uncover<2->{\node [yellow, left=0.2cm of yellow4] (yellow5) {current\underline{ }version/};} \uncover<2-3>{\node [green, left=4.0cm of dummy1] (green) {/$<$tmpdir$>$/$<$username$>$.$<$randomnumber$>$};} \draw<2-3> [-] (green.east) -- (dummy1.center); \draw<2-3> [-] (dummy2.center) -- (dummy1.center); \draw<2-3> [-] (dummy3.center) -- (dummy1.center); \draw<2-3> [->] (dummy2.center) -- (yellow1.east); \draw<2-3> [->] (dummy3.center) -- (yellow2.east); \draw<2-> [-] (yellow2.west) -- (yellow3.east); \draw<2-> [-] (yellow3.west) -- (yellow4.east); \draw<2-> [-] (yellow4.west) -- (yellow5.east); \end{tikzpicture} \end{center} \item<3-> Delete the temporary working directory\\ \quad \texttt{rm -rf //.}\\ \vspace{2mm} \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?} \end{enumerate} \end{frame} % Folie 7 \begin{frame} \tikzstyle{small} = [rectangle, text width=0.08\textwidth, font=\scriptsize] \tikzstyle{large} = [rectangle, text width=0.45\textwidth, font=\scriptsize] \tikzstyle{box} = [rectangle, draw, text width=0.2\textwidth, font=\scriptsize] \tikzstyle{boxbig} = [rectangle, draw, text width=0.4\textwidth, font=\scriptsize] \tikzstyle{dummy} = [rectangle, text width=0.0\textwidth, font=\scriptsize, minimum height=0.5cm] \frametitle{Steering File Copy by the Configuration File (I)} \scriptsize \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.}\\ \vspace{3mm} Principle example of a file connection statement (for the PALM parameter file): \vspace{-3mm} \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<1->{\node [small] (part1) {\texttt{PARIN}};} \uncover<1->{\node [dummy, left=-0.2cm of part1] (dummy1) {};} \uncover<1->{\node [dummy, below=1.25cm of dummy1] (dummy3) {};} \uncover<1->{\node [small, right=0.0cm of part1] (part2) {\quad \texttt{in}};} \uncover<1->{\node [dummy, right=0.0cm of part2] (dummy2) {};} \uncover<1->{\node [small, right=0.2cm of part2] (part3) {\texttt{d3\#}};} \uncover<1->{\node [large, right=0.0cm of part3] (part4) {\texttt{\~{}/palm/current\underline{ }version/JOB/INPUT}};} \uncover<1->{\node [small, right=0.0cm of part4] (part5) {\texttt{\underline{ }p3d}};} \uncover<1->{\node [small, right=0.2cm of part5] (part6) {\texttt{( \textcolor{red}{nc} )}};} \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)};} \draw<2-> [->] (dummy3.north) -- (dummy1.south); \uncover<3->{\node [box, below=0.7cm of part2] (box2) {file attributes};} \draw<3-> [->] (box2.north) -- (part2.south); \uncover<4->{\node [box, below=0.2cm of part3] (box3) {activating string};} \draw<4-> [->] (box3.north) -- (part3.south); \uncover<5->{\node [box, below=0.2cm of part4] (box4) {directory in which the permanent user file resides};} \draw<5-> [->] (box4.north) -- (part4.south); \uncover<6->{\node [box, below=0.2cm of part5] (box5) {suffix of the permanent filename};} \draw<6-> [->] (box5.north) -- (part5.south); \uncover<7->{\node [box, below=1.0cm of part6] (box6) {additional suffix for netCDF files};} \draw<7-> [->] (box6.north) -- (part6.south); \end{tikzpicture} \end{center} \end{frame} % Folie 8 \begin{frame} \tikzstyle{small} = [rectangle, text width=0.08\textwidth, font=\scriptsize] \tikzstyle{large} = [rectangle, text width=0.45\textwidth, font=\scriptsize] \tikzstyle{box} = [rectangle, draw, text width=0.2\textwidth, font=\scriptsize] \tikzstyle{boxbig} = [rectangle, draw, text width=0.4\textwidth, font=\scriptsize] \tikzstyle{dummy} = [rectangle, text width=0.0\textwidth, font=\scriptsize, minimum height=0.5cm] \frametitle{Steering File Copy by the Configuration File (II)} \scriptsize \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<1->{\node [small] (part1) {\texttt{PARIN}};} \uncover<1->{\node [dummy, left=-0.2cm of part1] (dummy1) {};} \uncover<1->{\node [dummy, below=1.25cm of dummy1] (dummy3) {};} \uncover<1->{\node [small, right=0.0cm of part1] (part2) {\quad \texttt{in}};} \uncover<1->{\node [dummy, right=0.0cm of part2] (dummy2) {};} \uncover<1->{\node [small, right=0.2cm of part2] (part3) {\texttt{d3\#}};} \uncover<1->{\node [large, right=0.0cm of part3] (part4) {\texttt{\~{}/palm/current\underline{ }version/JOB/INPUT}};} \uncover<1->{\node [small, right=0.0cm of part4] (part5) {\texttt{\underline{ }p3d}};} \uncover<1->{\node [small, right=0.2cm of part5] (part6) {\texttt{( \textcolor{red}{nc} )}};} \uncover<1->{\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)};} \draw<1-> [->] (dummy3.north) -- (dummy1.south); \uncover<1->{\node [box, below=0.7cm of part2] (box2) {file attributes};} \draw<1-> [->] (box2.north) -- (part2.south); \uncover<1->{\node [box, below=0.2cm of part3] (box3) {activating string};} \draw<1-> [->] (box3.north) -- (part3.south); \uncover<1->{\node [box, below=0.2cm of part4] (box4) {directory in which the permanent user file resides};} \draw<1-> [->] (box4.north) -- (part4.south); \uncover<1->{\node [box, below=0.2cm of part5] (box5) {suffix of the permanent filename};} \draw<1-> [->] (box5.north) -- (part5.south); \uncover<1->{\node [box, below=1.0cm of part6] (box6) {additional suffix for netCDF files};} \draw<1-> [->] (box6.north) -- (part6.south); \end{tikzpicture} \end{center} \vspace{3mm} \onslide<2->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}:\\ \footnotesize \quad \texttt{mrun -d \textcolor{blue}{example\underline{ }cbl} ...}\\ \vspace{1mm} \scriptsize gives the filename\\ \vspace{1mm} \footnotesize \quad \texttt{\~{}/palm/current\underline{ }version/JOB/INPUT/\textcolor{blue}{example\underline{ }cbl}\underline{ }p3d}\\ \quad \texttt{( ... /\textcolor{blue}{example\underline{ }cbl}\underline{ }p3d\textcolor{red}{.nc} )} \end{frame} % Folie 9 \begin{frame} \frametitle{Steering File Copy by the Configuration File (III)} \tiny \onslide<1-> The \textbf{base name} can additionally be a part of the directory name by using \textcolor{blue}{\texttt{\$fname}} in the directory column of the file connection statement:\\ \vspace{1mm} \scriptsize\quad \texttt{PARIN in d3\# \~{}/palm/current\underline{ }version/JOBS/\textcolor{blue}{\$fname}/INPUT \underline{ }p3d}\\ \vspace{4mm} \onslide<2-> \tiny Using the call\\ \vspace{1mm} \scriptsize \quad \texttt{mrun -d \textcolor{blue}{abcde} ...}\\ \vspace{1mm} \tiny the input file will be expected under\\ \vspace{1mm} \scriptsize \quad \texttt{\~{}/palm/current\underline{ }version/JOBS/\textcolor{blue}{abcde}/INPUT/\textcolor{blue}{abcde}\underline{ }p3d }\\ \vspace{4mm} \onslide<3-> \tiny In this way, all files handled by the \texttt{mrun}-call are stored in the same subdirectory (\textcolor{blue}{abcde/}) and will have the same string (\texttt{\textcolor{blue}{abcde}}) as part of their names, so they can be easily identified as \grqq belonging\grqq\, to the model run initiated by that \texttt{mrun} call.\\ \ \\ \onslide<4-> Instead of always writing the full path name (i.e. \texttt{\~{}/palm/current\underline{ }version/JOBS}), an environment variable can be declared for this at the beginning of the configuration file and be used in the file connection statements:\\ \vspace{1mm} \scriptsize \quad \texttt{\%base\underline{ }data \~{}/palm/current\underline{ }version/JOBS}\\ \quad \texttt{PARIN in d3\# \textcolor{blue}{\$base\underline{ }data}/\textcolor{blue}{\$fname}/INPUT \underline{ }p3d}\\ \ \\ \onslide<5-> \tiny This easily allows to change the directories for all input/output files by just changing the value of \texttt{base\underline{ }data}. \end{frame} % Folie 10 \begin{frame} \frametitle{Steering File Copy by the Configuration File (IV)} \tiny \onslide<1-> File connection statements which shall be carried out, have to be activated by giving their activation string in the \texttt{mrun}-option \texttt{-r}:\\ \vspace{1mm} \scriptsize \quad \texttt{PARIN in d3\# \~{}/palm/current\underline{ }version/JOBS/\$fname/INPUT \underline{ }p3d}\\ \ \\ \onslide<2-> \tiny The permanent file\\ \vspace{1mm} \scriptsize \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/INPUT/example\underline{ }cbl\underline{ }p3d} \\ \vspace{2mm} \tiny will only be copied to the local file PARIN by using the call:\\ \vspace{1mm} \scriptsize \quad \texttt{mrun -d example\underline{ }cbl -r \dq d3\#\dq\, ...}\\ \ \\ \onslide<3-> \tiny \textbf{Example for an output file:}\\ The file connection statement\\ \vspace{1mm} \scriptsize \quad \texttt{DATA\underline{ }1D\underline{ }PR\_NETCDF out:loc pr\# } \\ ~~~~~~\texttt{\~{}/palm/current\underline{ }version/JOBS/\$fname/OUTPUT \underline{ }pr nc}s\\ \vspace{2mm} \onslide<4-> \tiny will copy (after program execution) the local file \\ \texttt{DATA\underline{ }1D\underline{ }PR\underline{ }NETCDF} to the permanent file \\ \vspace{1mm} \scriptsize \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/example\underline{ }cbl\underline{ }pr.nc}\\ \vspace{1mm} \tiny if \texttt{mrun} is called with the options\\ \vspace{1mm} \scriptsize \quad \texttt{mrun -d example\underline{ }cbl -r \dq d3\# pr\#\dq\, ...} \end{frame} % Folie 11 \begin{frame} \frametitle{Steering File Copy by the Configuration File (V)} \scriptsize \onslide<1-> \texttt{mrun} never replaces/overwrites existing files!\\ \ \\ \tiny Instead, new, so-called file cycles are created.\\ If an output file, e.g.\\ \vspace{1mm} \scriptsize \quad \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/MONITORING/example\underline{ }cbl\underline{ }rc}\\ \ \\ \ \\ \tiny has been created from a first call of \texttt{mrun} and if the same \texttt{mrun} call is submitted again, the second call will not replace the file \texttt{example\underline{ }cbl\underline{ }rc}, but will create a new file with name:\\ \vspace{1mm} \scriptsize \quad \texttt{\~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/MONITORING/example\underline{ }cbl\underline{ }rc.1}\\ \ \\ \ \\ \onslide<2-> \tiny In case of netCDF-files, the file cycle number is inserted before the netCDF-suffix .nc, e.g.\\ \vspace{1mm} \scriptsize \quad \texttt{example\underline{ }cbl\underline{ }pr.1.nc}\\ \ \\ \ \\ \onslide<3-> \tiny The implemented file cycle mechanism does not allow to use any other dots "'."' in the path or filename:\\ \vspace{1mm} \scriptsize \quad \texttt{\~{}/palm/version\underline{ }3.6/JOBS/example.sbl/MONITORING/example.sbl\underline{ }rc}\\ \end{frame} % Folie 12 \begin{frame}[fragile] \frametitle{\normalsize File Connection Statements From the Default \texttt{.mrun.config} file} \begin{columns} \column{1.1\textwidth} \tiny \begin{lstlisting} #---------------------------------------------------------------------------- # List of input-files #---------------------------------------------------------------------------- PARIN in:job d3# $base_data/$fname/INPUT _p3d PARIN in:job d3f $base_data/$fname/INPUT _p3df TOPOGRAPHY_DATA in:locopt d3#:d3f $base_data/$fname/INPUT _topo NUDGING_DATA in:locopt d3#:d3f $base_data/$fname/INPUT _nudge LSF_DATA in:locopt d3#:d3f $base_data/$fname/INPUT _lsf BININ in:loc:flpe d3f $base_data/$fname/RESTART _d3d PARTICLE_RESTART_DATA_IN in:loc:flpe prtf $base_data/$fname/RESTART _rprt DATA_1D_PR_NETCDF in:locopt prf $base_data/$fname/OUTPUT _pr nc DATA_1D_SP_NETCDF in:locopt spf $base_data/$fname/OUTPUT _sp nc DATA_1D_TS_NETCDF in:locopt tsf $base_data/$fname/OUTPUT _ts nc DATA_1D_PTS_NETCDF in:locopt ptsf $base_data/$fname/OUTPUT _pts nc DATA_2D_XY_NETCDF in:locopt xyf $base_data/$fname/OUTPUT _xy nc DATA_2D_XY_AV_NETCDF in:locopt xyf $base_data/$fname/OUTPUT _xy_av nc DATA_2D_XZ_NETCDF in:locopt xzf $base_data/$fname/OUTPUT _xz nc DATA_2D_YZ_NETCDF in:locopt yzf $base_data/$fname/OUTPUT _yz nc DATA_3D_NETCDF in:locopt 3df $base_data/$fname/OUTPUT _3d nc DATA_PRT_NETCDF in:locopt:pe prtf $base_data/$fname/OUTPUT _prt # #---------------------------------------------------------------------------- # List of output-files #---------------------------------------------------------------------------- BINOUT out:loc:flpe restart $base_data/$fname/RESTART _d3d PARTICLE_RESTART_DATA_OUT out:loc:flpe prt#:prtf $base_data/$fname/RESTART _rprt # RUN_CONTROL out:loc:tr d3# $base_data/$fname/MONITORING _rc RUN_CONTROL out:loc:tra d3f $base_data/$fname/MONITORING _rc HEADER out:loc:tr d3# $base_data/$fname/MONITORING _header HEADER out:loc:tra d3f $base_data/$fname/MONITORING _header CPU_MEASURES out:loc:tr d3# $base_data/$fname/MONITORING _cpu CPU_MEASURES out:loc:tra d3f $base_data/$fname/MONITORING _cpu \end{lstlisting} \end{columns} \end{frame} % Folie 13 \begin{frame}[fragile] \frametitle{Additional Features of \texttt{mrun} (I)} \tikzstyle{yellow} = [rectangle, draw, fill=yellow!30, text width=0.975\textwidth, font=\Tiny] \begin{itemize} \footnotesize \item<1-> Generating batch jobs on local \textbf{and} remote host. \item<2-> Setting of unix environment variables for job and model control (e.g. for determining compiler options, etc.). \item<3-> Values have to be set in the \texttt{mrun} configuration file \texttt{.mrun.config}: \end{itemize} \onslide<4-> \begin{center} \begin{tikzpicture} \node [yellow]{\begin{lstlisting} %tmp_user_catalog /gfs1/work/ lccrayh parallel %tmp_data_catalog /gfs1/work/ lccrayh parallel %compiler_name ftn lccrayh parallel %compiler_name_ser ftn lccrayh parallel %cpp_options -e:Z:-DMPI_REAL=MPI_DOUBLE_PRECISION:-DMPI_2REAL=MPI_2DOUBLE_PRECISION:... %mopts -j:4 lccrayh parallel %fopts -em:-O3:-hnoomp:-hfp3:-hdynamic lccrayh parallel %lopts -em:-O3:-hnoomp:-hfp3:-hdynamic:-dynamic lccrayh parallel %remote_username lccrayh parallel %memory 1500 lccrayh parallel %modules fftw:cray-hdf5-parallel:cray-netcdf-hdf5parallel lccrayh parallel \end{lstlisting}}; \end{tikzpicture} \end{center} \end{frame} % Folie 14 \begin{frame}[fragile] \frametitle{Additional Features of \texttt{mrun} (II)} \tikzstyle{yellow} = [rectangle, draw, fill=yellow!30, text width=0.9\textwidth, font=\Tiny] \begin{itemize} \footnotesize \item<1-> 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). These commands can also be defined in the \texttt{mrun} configuration file: \onslide<2-> \begin{center} \begin{tikzpicture} \node [yellow]{\begin{lstlisting} IC:echo ``PALM will soon start to execute in \$PWD'' > /home/h/niksiraa/mrun_messages EC:ls -al OC:tar -cf DEBUG.tar DEBUG_* \end{lstlisting}}; \end{tikzpicture} \end{center} \item<3-> Automatic generation of restart jobs. \end{itemize} \end{frame} % Folie 15 \begin{frame}[fragile] \frametitle{PALM \textit{Interactive} Example Run Using \texttt{mrun}: Tracing the Run by the User} \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.35\textwidth, font=\tiny, minimum height=0.6cm] \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.35\textwidth, font=\tiny, minimum height=0.6cm] \tikzstyle{yellow_big} = [rectangle, draw, fill=yellow!20, text width=0.55\textwidth, font=\tiny, minimum height=0.6cm] \tikzstyle{notes} = [rectangle, text width=0.26\textwidth, font=\tiny, minimum height=0.6cm] \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\tiny, minimum height=0.6cm] \tikzstyle{green_term} = [rectangle, draw, fill=green!30, text width=0.83\textwidth, font=\Tiny,scale=0.6] \vspace{-1.0cm} \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<1->{\node [yellow] (box1) {\textbf{start run on local machine:}\\ \texttt{mrun -d example\underline{ }cbl -h lcmuknb ...}};} \uncover<1->{\node [dummy, right=1.4cm of box1] (dummy1) {};} \uncover<2->{\node [notes, above=-0.3cm of dummy1] (notes1) {temporary working directory is created, all required files are copied there};} \uncover<3->{\node [green, right=1.4cm of dummy1] (box2) {\textbf{follow run messages on terminal}};} \uncover<4->{\node [green, below=0.5cm of box2] (box3) { \textbf{as soon as message} \texttt{*** execution starts in directory\\ \quad \dq \dq\, }\\ \ \\ \textbf{you can change to this directory (in a new terminal) and watch the progess of timesteps} \texttt{cd }\\ \texttt{tail -f RUN\underline{ }CONTROL}\\ \ \\ However, this might be difficult in case of short run times, because the run may have finished before you have entered the commands! };} \coordinate[below=0.3cm of box3] (A); \uncover<1->{\node [dummy, left=0.3cm of box3] (dummy2) {};} \uncover<6->{\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};} \uncover<7->{\node [yellow_big, left=2.5cm of A] (box4) { \textbf{check, if the output files have sucessfully been transferred to the permanent directory:}\\ \texttt{cd \~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/MONITORING}\\ \texttt{ls -al}\\ \texttt{cd \~{}/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT}\\ \texttt{ls -al} };} \draw<2-> [->,color=blue] (box1.east) -- (box2.west); \draw<4-> [->,color=blue] (box2.south) -- (box3.north); \draw<6-> [-,color=blue] (box3.south) -- (A); \draw<6-> [->,color=blue] (A) -- (box4.east); \onslide<5->\node [green_term, left=1.2cm of box3] (terminal) {\begin{lstlisting} *** running on: laptop laptop ... reading environment parameters from ENVPAR --- finished ... reading NAMELIST parameters from PARIN --- finished ... creating virtual PE grids + MPI derived data types --- finished ... checking parameters --- finished ... allocating arrays --- finished ... initializing with constant profiles --- finished ... initializing statistics, boundary conditions, etc. --- finished ... creating initial disturbances --- finished ... calling pressure solver --- finished --- leaving init_3d_model --- start with time-stepping [XXXXXXXXXXXXXXXXXXXXXXXXXXXX________________________________] 53.3 left \end{lstlisting} }; \uncover<5->{\node [notes, above=0.0cm of terminal, text width=0.55\textwidth] (notes_terminal) {Starting from version 3.10 (r 1402), some progress messages and a progress bar for estimating the time required to finish the simulation is output on the terminal};} %\draw<5-> [->,color=blue] (box3.west) -- (terminal.east); \onslide<1-> \end{tikzpicture} \end{center} \end{frame} % Folie 16 \begin{frame} \frametitle{PALM \textit{Batch} Example Run (on HLRN, remote) Using \texttt{mrun}: Tracing the Run by the User} \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.3\textwidth, font=\Tiny] \tikzstyle{yellow2} = [rectangle, draw, fill=yellow!20, text width=0.4\textwidth, font=\Tiny] \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.4\textwidth, font=\Tiny] \tikzstyle{dummy} = [text width=0.2\textwidth, font=\Tiny] \tikzstyle{alert} = [rectangle, draw, text width=0.5\textwidth, font=\scriptsize] \tikzstyle{line} = [draw, -latex'] \begin{itemize} \item \small Reminder: Running batch jobs requires a directory \texttt{~/job\underline{ }queue} for the job protocol files on the local \underline{and} remote host. \end{itemize} \begin{tikzpicture}[auto, node distance=0] \node [yellow] (first) { \textbf{start job on local machine:}\\ \texttt{mrun -d example\underline{ }cbl -h lccrayh ...} }; \uncover<2->{ \node [dummy, right=0.5cm of first] (dummy) { transfer of job by \texttt{scp} \\ \ \\ \ \\ submit of job by executing the \texttt{msub} command via \texttt{ssh} }; } \uncover<3->{ \node [green, right=3.5cm of first] (second) { \textbf{follow job execution on remote host, by} \\ \texttt{showq} (better: \texttt{showq | grep hzkurs}) }; } \uncover<4->{ \node [green, below=0.2cm of second] (third) { \textbf{if job is running, you may follow its progress by watching the job protocol (does not work on HLRN-III system!):} \\ \texttt{cd \~{}/job\underline{ }queue \\ tail lcmuk\underline{ }example\underline{ }cbl} }; } \uncover<5->{ \node [green, below=0.2cm of third] (fourth) { \textbf{when job is running, change to directory \texttt{} and try to find there the latest directory \texttt{.} \\ change to this directory and execute}\\ \texttt{tail -f RUN\underline{ }CONTROL} }; } \uncover<6->{ \node [green, below=0.2cm of fourth] (fifth) { \textbf{when the job is finished, watch, if the job protocol is transferred to the local host without errors:}\\ \texttt{cd \~{}/job\underline{ }queue \\ cat last\underline{ }job\underline{ }transfer\underline{ }protocol} }; } \uncover<7->{ \node [dummy, left=0.001mm of fifth] (dummy) { transfer results by \texttt{scp} \\ \ \\ \ \\ }; } \uncover<8->{ \node [yellow2, left=2.5cm of fifth] (sixth) { \textbf{check, if the job protocol and all output files have successfully been transferred to the local machine:}\\ \texttt{cd \~{}/job\_queue \\ ls -al \\ cd \~{}/palm/current\_version/JOBS/example \\ ls -al *} }; } \uncover<9->{ \node [alert, below=0.5cm of first.south east] (alert) { \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 \textbf{mrun} and \textbf{subjob} script!} }; } \path<2-> [line] (first) -- (second); \path<4-> [line] (second) -- (third); \path<5-> [line] (third) -- (fourth); \path<6-> [line] (fourth) -- (fifth); \path<7-> [line] (fifth) -- (sixth); \end{tikzpicture} \end{frame} % Folie 17 \begin{frame} \tikzstyle{green} = [rectangle, draw, fill=green!20, text width=0.45\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{green_small} = [rectangle, draw, fill=green!20, text width=0.12\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{yellow_small} = [rectangle, draw, fill=yellow!20, text width=0.1\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{yellow} = [rectangle, draw, fill=yellow!20, text width=0.18\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{dummy} = [rectangle, text width=0.01\textwidth, font=\scriptsize, minimum height=0.6cm] \tikzstyle{notes} = [rectangle, text width=0.15\textwidth, font=\scriptsize, minimum height=0.6cm] \frametitle{PALM Runs Using \texttt{mrun}: Further Details} \begin{itemize} \footnotesize \item<2-> For every (initial) run, \texttt{mrun} creates a source directory which contains copies of \begin{itemize} \footnotesize \item<4-> those source code files to be translated (always the main program, \texttt{palm.f90}, plus user interface files) \item<4-> the Makefile \item<5-> the configuration file \item<6-> the mrun script \end{itemize} \end{itemize} \vspace{-0.8cm} \begin{center} \begin{tikzpicture}[auto, node distance=0] \uncover<3->{\node [yellow_small] (box1) {\$HOME/};} \uncover<3->{\node [yellow_small, right=0.2cm of box1] (box2) {palm/};} \uncover<3->{\node [yellow, right=0.2cm of box2] (box3) {current\underline{ }version/};} \uncover<3->{\node [green_small, right=0.4cm of box3] (box4) {trunk/};} \uncover<1->{\node [dummy, right=1.0cm of box4] (dummy1) {};} \uncover<3->{\node [green_small, above=-0.2cm of dummy1] (box5) {SCRIPTS};} \uncover<3->{\node [green_small, below=-0.2cm of dummy1] (box6) {SOURCE};} \uncover<6->{\node [notes, right=0.1cm of box5] (notes1) {\texttt{mrun}};} \uncover<4->{\node [notes, right=0.1cm of box6] (notes2) {\texttt{Makefile \\ palm.f90}};} \uncover<5->{\node [notes, below=0.1cm of box3] (notes3) {\texttt{.mrun.config}};} \uncover<3->{\node [green, below=0.2cm of box6] (box7) {SOURCES\underline{ }FOR\underline{ }RUN\underline{ }$<$run\underline{ }identifier$>$};} \uncover<1->{\node [dummy, left=1.5cm of box7] (dummy2) {};} \uncover<1->{\node [dummy, right=2.0cm of box5] (dummy3) {};} \uncover<1->{\node [dummy, right=1.8cm of box6] (dummy4) {};} \uncover<1->{\node [dummy, below=0.2cm of dummy4] (dummy5) {};} \draw<3-> [-] (box1.east) -- (box2.west); \draw<3-> [-] (box2.east) -- (box3.west); \draw<3-> [-] (box3.east) -- (box4.west); \draw<3-> [-] (box4.east) -- (box5.west); \draw<3-> [-] (box4.east) -- (box6.west); \draw<3-> [-] (box3.east) -- (box7.west); \draw<6-> [-] ([xshift=-0.8cm]notes1.east) -- (dummy3.center); \draw<4-> [-] ([xshift=-0.4cm]notes2.east) -- (dummy4.center); \draw<4-> [-] (dummy4.center) -- ([yshift=0.1cm]dummy5.center); \draw<4-> [->] ([yshift=0.1cm]dummy5.center) -- ([yshift=0.1cm]box7.east); \draw<6-> [-] (dummy3.center) -- ([xshift=0.2cm, yshift=-0.1cm]dummy5.center); \draw<6-> [->] ([xshift=0.2cm, yshift=-0.1cm]dummy5.center) -- ([yshift=-0.1cm]box7.east); \draw<5-> [-] ([yshift=0.3cm]dummy2.center) -- (dummy2.center); \draw<5-> [->] (dummy2.center) -- (box7.west); \end{tikzpicture} \end{center} \begin{itemize} \footnotesize \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. \end{itemize} \end{frame} % Folie 17 \begin{frame} \footnotesize \texttt{mrun} \frametitle{PALM Runs Using \texttt{mrun}: most important \texttt{mrun} options} \begin{itemize} \footnotesize \item<2-> \texttt{-d example\_cbl} \begin{itemize} \item[] \tiny run identifier, basefile/directory name of all data files of this run \end{itemize} \item<3-> \texttt{-h} host identifier \begin{itemize} \item[] \tiny host on which the run shall be performed (reminder: this is not the UNIX hostname):\\ \texttt{lcmuknb, lcmuk, lccrayh...} \end{itemize} \item<4-> \texttt{-K parallel} \begin{itemize} \item[] \tiny run in parallel on several processor cores \end{itemize} \item<5-> \texttt{-X 4} \begin{itemize} \item[] \tiny number of processors to be used \end{itemize} \item<6-> \texttt{-T 4} \begin{itemize} \item[] \tiny number of tasks to be started on one node of the computer \end{itemize} \item<7-> \texttt{-t 100} \begin{itemize} \item[] \tiny CPU time allowed to be used for the batch jobs \end{itemize} \item<8-> \texttt{-b} \begin{itemize} \item[] \tiny run in batch mode \end{itemize} \item<9-> \texttt{-q mpp1q} \begin{itemize} \item[] \tiny batch job queue \end{itemize} \item<10-> \texttt{-r \dq ...\dq} \begin{itemize} \item[] \tiny activation strings \end{itemize} \end{itemize} \end{frame} \end{document}