source: flex_extract.git/Documentation/html/Documentation/Input/compilejob.html @ 47be2684

ctbtodev
Last change on this file since 47be2684 was 6931f61, checked in by anphi <anne.philipp@…>, 4 years ago

Update Onlinedocumentation after review of language editing

  • Property mode set to 100644
File size: 17.4 KB
Line 
1
2
3<!DOCTYPE html>
4<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6<head>
7  <meta charset="utf-8">
8 
9  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10 
11  <title>The compilation job script compilejob.ksh &mdash; flex_extract 7.1.2 documentation</title>
12 
13
14 
15 
16 
17 
18
19 
20  <script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
21 
22   
23      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
24        <script src="../../_static/jquery.js"></script>
25        <script src="../../_static/underscore.js"></script>
26        <script src="../../_static/doctools.js"></script>
27        <script src="../../_static/language_data.js"></script>
28        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
29   
30    <script type="text/javascript" src="../../_static/js/theme.js"></script>
31
32   
33
34 
35  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
36  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
37  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
38  <link rel="stylesheet" href="../../_static/css/theme_overrides.css" type="text/css" />
39    <link rel="index" title="Index" href="../../genindex.html" />
40    <link rel="search" title="Search" href="../../search.html" />
41    <link rel="next" title="The Fortran makefile for calc_etadot" href="fortran_makefile.html" />
42    <link rel="prev" title="The installation script - setup.sh" href="setup.html" /> 
43</head>
44
45<body class="wy-body-for-nav">
46
47   
48  <div class="wy-grid-for-nav">
49   
50    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
51      <div class="wy-side-scroll">
52        <div class="wy-side-nav-search" >
53         
54
55         
56            <a href="../../index.html" class="icon icon-home"> flex_extract
57         
58
59         
60          </a>
61
62         
63           
64           
65              <div class="version">
66                7.1.2
67              </div>
68           
69         
70
71         
72<div role="search">
73  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
74    <input type="text" name="q" placeholder="Search docs" />
75    <input type="hidden" name="check_keywords" value="yes" />
76    <input type="hidden" name="area" value="default" />
77  </form>
78</div>
79
80         
81        </div>
82
83        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
84         
85           
86           
87             
88           
89           
90              <p class="caption"><span class="caption-text">Table of Contents:</span></p>
91<ul class="current">
92<li class="toctree-l1"><a class="reference internal" href="../../ecmwf_data.html">ECMWF Data</a></li>
93<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a></li>
94<li class="toctree-l1"><a class="reference internal" href="../../quick_start.html">Usage</a></li>
95<li class="toctree-l1 current"><a class="reference internal" href="../../documentation.html">Code-Level Documentation</a><ul class="current">
96<li class="toctree-l2"><a class="reference internal" href="../overview.html">Overview</a></li>
97<li class="toctree-l2 current"><a class="reference internal" href="../input.html">Control &amp; input data</a><ul class="current">
98<li class="toctree-l3"><a class="reference internal" href="setup.html">The installation script - <code class="docutils literal notranslate"><span class="pre">setup.sh</span></code></a></li>
99<li class="toctree-l3 current"><a class="current reference internal" href="#">The compilation job script <code class="docutils literal notranslate"><span class="pre">compilejob.ksh</span></code></a><ul>
100<li class="toctree-l4"><a class="reference internal" href="#what-does-the-compilation-script-do">What does the compilation script do?</a></li>
101<li class="toctree-l4"><a class="reference internal" href="#example-compilejob-ksh">Example <code class="docutils literal notranslate"><span class="pre">compilejob.ksh</span></code></a></li>
102</ul>
103</li>
104<li class="toctree-l3"><a class="reference internal" href="fortran_makefile.html">The Fortran makefile for <code class="docutils literal notranslate"><span class="pre">calc_etadot</span></code></a></li>
105<li class="toctree-l3"><a class="reference internal" href="run.html">The executable script - <code class="docutils literal notranslate"><span class="pre">run.sh</span></code></a></li>
106<li class="toctree-l3"><a class="reference internal" href="jobscript.html">The job script <code class="docutils literal notranslate"><span class="pre">job.ksh</span></code></a></li>
107<li class="toctree-l3"><a class="reference internal" href="control.html">The CONTROL file</a></li>
108<li class="toctree-l3"><a class="reference internal" href="control_params.html">The CONTROL parameters</a></li>
109<li class="toctree-l3"><a class="reference internal" href="examples.html">CONTROL file examples</a></li>
110<li class="toctree-l3"><a class="reference internal" href="changes.html">CONTROL file changes</a></li>
111<li class="toctree-l3"><a class="reference internal" href="ecmwf_env.html">ECMWF user credential file <code class="docutils literal notranslate"><span class="pre">ECMWF_ENV</span></code></a></li>
112<li class="toctree-l3"><a class="reference internal" href="templates.html">Templates</a></li>
113</ul>
114</li>
115<li class="toctree-l2"><a class="reference internal" href="../output.html">Output data</a></li>
116<li class="toctree-l2"><a class="reference internal" href="../disagg.html">Disaggregation of flux data</a></li>
117<li class="toctree-l2"><a class="reference internal" href="../vertco.html">Vertical wind</a></li>
118<li class="toctree-l2"><a class="reference internal" href="../api.html">Auto-generated documentation</a></li>
119</ul>
120</li>
121<li class="toctree-l1"><a class="reference internal" href="../../evaluation.html">Evaluation</a></li>
122<li class="toctree-l1"><a class="reference internal" href="../../dev_guide.html">Developer Guide</a></li>
123<li class="toctree-l1"><a class="reference internal" href="../../changelog.html">Changelog</a></li>
124<li class="toctree-l1"><a class="reference internal" href="../../support.html">Support</a></li>
125<li class="toctree-l1"><a class="reference internal" href="../../Support/faq.html">FAQ - Frequently asked questions</a></li>
126<li class="toctree-l1"><a class="reference internal" href="../../authors.html">Developer Team</a></li>
127</ul>
128
129           
130         
131        </div>
132      </div>
133    </nav>
134
135    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
136
137     
138      <nav class="wy-nav-top" aria-label="top navigation">
139       
140          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
141          <a href="../../index.html">flex_extract</a>
142       
143      </nav>
144
145
146      <div class="wy-nav-content">
147       
148        <div class="rst-content">
149       
150         
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166<div role="navigation" aria-label="breadcrumbs navigation">
167
168  <ul class="wy-breadcrumbs">
169   
170      <li><a href="../../index.html">Docs</a> &raquo;</li>
171       
172          <li><a href="../../documentation.html">Code-Level Documentation</a> &raquo;</li>
173       
174          <li><a href="../input.html">Control &amp; input data</a> &raquo;</li>
175       
176      <li>The compilation job script <code class="docutils literal notranslate"><span class="pre">compilejob.ksh</span></code></li>
177   
178   
179      <li class="wy-breadcrumbs-aside">
180       
181           
182            <a href="../../_sources/Documentation/Input/compilejob.rst.txt" rel="nofollow"> View page source</a>
183         
184       
185      </li>
186   
187  </ul>
188
189 
190  <hr/>
191</div>
192          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
193           <div itemprop="articleBody">
194           
195  <div class="section" id="the-compilation-job-script-compilejob-ksh">
196<h1>The compilation job script <code class="docutils literal notranslate"><span class="pre">compilejob.ksh</span></code><a class="headerlink" href="#the-compilation-job-script-compilejob-ksh" title="Permalink to this headline"></a></h1>
197<p>The compile job is a Korn-shell script which will be created during the installation process for the application modes <strong>remote</strong> and <strong>gateway</strong> from a template called <code class="docutils literal notranslate"><span class="pre">installscript.template</span></code> in the template directory.</p>
198<p><code class="docutils literal notranslate"><span class="pre">Flex_extract</span></code> uses the Python package <a class="reference external" href="https://genshi.edgewall.org/">genshi</a> to generate
199the Korn-shell script from the template files by substituting the individual parameters.
200These individual parameters are marked by a doubled <code class="docutils literal notranslate"><span class="pre">$</span></code> sign in <code class="docutils literal notranslate"><span class="pre">installscript.template</span></code>.</p>
201<p>The compilation script has a number of settings for the batch system which are fixed, and it differentiates between the <em>ecgate</em> and the <em>cca/ccb</em>
202server system to load the necessary modules for the environment when submitted to the batch queue.</p>
203<p>The submission is done by the <code class="docutils literal notranslate"><span class="pre">ECaccess</span></code> tool from within <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code> with the command <code class="docutils literal notranslate"><span class="pre">ecaccess-job-submit</span></code>.</p>
204<div class="section" id="what-does-the-compilation-script-do">
205<h2>What does the compilation script do?<a class="headerlink" href="#what-does-the-compilation-script-do" title="Permalink to this headline"></a></h2>
206<blockquote>
207<div><ol class="arabic simple">
208<li><p>It sets the necessary batch-system parameters</p></li>
209<li><p>It prepares the job environment at the ECMWF servers by loading the necessary library modules</p></li>
210<li><p>It sets some environment variables for the single session</p></li>
211<li><p>It creates the <code class="docutils literal notranslate"><span class="pre">flex_extract</span></code> root directory in the <code class="docutils literal notranslate"><span class="pre">$HOME</span></code> path of the user</p></li>
212<li><p>It untars the tarball into the root directory.</p></li>
213<li><p>It compiles the Fortran program using <code class="docutils literal notranslate"><span class="pre">makefile</span></code>.</p></li>
214<li><p>At the end, it checks whether the script has returned an error or not, and emails the log file to the user.</p></li>
215</ol>
216</div></blockquote>
217</div>
218<div class="section" id="example-compilejob-ksh">
219<h2>Example <code class="docutils literal notranslate"><span class="pre">compilejob.ksh</span></code><a class="headerlink" href="#example-compilejob-ksh" title="Permalink to this headline"></a></h2>
220<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/ksh</span>
221
222<span class="c1"># ON ECGB:</span>
223<span class="c1"># start with ecaccess-job-submit -queueName ecgb NAME_OF_THIS_FILE  on gateway server</span>
224<span class="c1"># start with sbatch NAME_OF_THIS_FILE directly on machine</span>
225
226<span class="c1">#SBATCH --workdir=/scratch/ms/at/km4a</span>
227<span class="c1">#SBATCH --qos=normal</span>
228<span class="c1">#SBATCH --job-name=flex_ecmwf</span>
229<span class="c1">#SBATCH --output=flex_ecmwf.%j.out</span>
230<span class="c1">#SBATCH --error=flex_ecmwf.%j.out</span>
231<span class="c1">#SBATCH --mail-type=FAIL</span>
232<span class="c1">#SBATCH --time=12:00:00</span>
233
234<span class="c1">## CRAY specific batch requests</span>
235<span class="c1">##PBS -N flex_ecmwf</span>
236<span class="c1">##PBS -q ns</span>
237<span class="c1">##PBS -S /usr/bin/ksh</span>
238<span class="c1">##PBS -o /scratch/ms/at/km4a/flex_ecmwf.${Jobname}.${Job_ID}.out</span>
239<span class="c1"># job output is in .ecaccess_DO_NOT_REMOVE</span>
240<span class="c1">##PBS -j oe</span>
241<span class="c1">##PBS -V</span>
242<span class="c1">##PBS -l EC_threads_per_task=1</span>
243<span class="c1">##PBS -l EC_memory_per_task=3200MB</span>
244
245<span class="nb">set</span> -x
246<span class="nb">export</span> <span class="nv">VERSION</span><span class="o">=</span><span class="m">7</span>.1
247<span class="k">case</span> <span class="si">${</span><span class="nv">HOST</span><span class="si">}</span> in
248  *ecg*<span class="o">)</span>
249  module unload grib_api
250  module unload emos
251  module load python3
252  module load eccodes
253  module load emos/455-r64
254  <span class="nb">export</span> <span class="nv">FLEXPART_ROOT_SCRIPTS</span><span class="o">=</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>
255  <span class="nb">export</span> <span class="nv">MAKEFILE</span><span class="o">=</span>makefile_ecgate
256  <span class="p">;;</span>
257  *cca*<span class="o">)</span>
258  module switch PrgEnv-cray PrgEnv-intel
259  module load python3
260  module load eccodes
261  module load emos/455-r64
262  <span class="nb">echo</span> <span class="si">${</span><span class="nv">GROUP</span><span class="si">}</span>
263  <span class="nb">echo</span> <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>
264  <span class="nb">echo</span> <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span> <span class="p">|</span> awk -F / <span class="s1">&#39;{print $1, $2, $3, $4}&#39;</span>
265  <span class="nb">export</span> <span class="nv">GROUP</span><span class="o">=</span><span class="sb">`</span><span class="nb">echo</span> <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span> <span class="p">|</span> awk -F / <span class="s1">&#39;{print $4}&#39;</span><span class="sb">`</span>
266  <span class="nb">export</span> <span class="nv">SCRATCH</span><span class="o">=</span>/scratch/ms/<span class="si">${</span><span class="nv">GROUP</span><span class="si">}</span>/<span class="si">${</span><span class="nv">USER</span><span class="si">}</span>
267  <span class="nb">export</span> <span class="nv">FLEXPART_ROOT_SCRIPTS</span><span class="o">=</span><span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>
268  <span class="nb">export</span> <span class="nv">MAKEFILE</span><span class="o">=</span>makefile_ecgate
269  <span class="p">;;</span>
270<span class="k">esac</span>
271
272mkdir -p <span class="si">${</span><span class="nv">FLEXPART_ROOT_SCRIPTS</span><span class="si">}</span>/flex_extract_v<span class="si">${</span><span class="nv">VERSION</span><span class="si">}</span>
273<span class="nb">cd</span> <span class="si">${</span><span class="nv">FLEXPART_ROOT_SCRIPTS</span><span class="si">}</span>/flex_extract_v<span class="si">${</span><span class="nv">VERSION</span><span class="si">}</span>   <span class="c1"># if FLEXPART_ROOT is not set this means cd to the home directory</span>
274tar -xvf <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span>/flex_extract_v<span class="si">${</span><span class="nv">VERSION</span><span class="si">}</span>.tar
275<span class="nb">cd</span> Source/Fortran
276<span class="se">\r</span>m *.o *.mod calc_etadot
277make -f <span class="si">${</span><span class="nv">MAKEFILE</span><span class="si">}</span> &gt;flexcompile <span class="m">2</span>&gt;flexcompile
278
279ls -l calc_etadot &gt;&gt;flexcompile
280<span class="k">if</span> <span class="o">[</span> <span class="nv">$?</span> -eq <span class="m">0</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
281  <span class="nb">echo</span> <span class="s1">&#39;SUCCESS!&#39;</span> &gt;&gt;flexcompile
282  mail -s flexcompile.<span class="si">${</span><span class="nv">HOST</span><span class="si">}</span>.<span class="nv">$$</span> <span class="si">${</span><span class="nv">USER</span><span class="si">}</span> &lt;flexcompile
283<span class="k">else</span>
284  <span class="nb">echo</span> Environment: &gt;&gt;flexcompile
285  env &gt;&gt; flexcompile
286  mail -s <span class="s2">&quot;ERROR! flexcompile.</span><span class="si">${</span><span class="nv">HOST</span><span class="si">}</span><span class="s2">.</span><span class="nv">$$</span><span class="s2">&quot;</span> <span class="si">${</span><span class="nv">USER</span><span class="si">}</span> &lt;flexcompile
287<span class="k">fi</span>
288</pre></div>
289</div>
290<div class="toctree-wrapper compound">
291</div>
292</div>
293</div>
294
295
296           </div>
297           
298          </div>
299          <footer>
300 
301    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
302     
303        <a href="fortran_makefile.html" class="btn btn-neutral float-right" title="The Fortran makefile for calc_etadot" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
304     
305     
306        <a href="setup.html" class="btn btn-neutral float-left" title="The installation script - setup.sh" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
307     
308    </div>
309 
310
311  <hr/>
312
313  <div role="contentinfo">
314    <p>
315        &copy; Copyright 2020, Anne Philipp, Leopold Haimberger and Petra Seibert
316
317    </p>
318  </div>
319  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
320
321</footer>
322
323        </div>
324      </div>
325
326    </section>
327
328  </div>
329 
330
331
332  <script type="text/javascript">
333      jQuery(function () {
334          SphinxRtdTheme.Navigation.enable(true);
335      });
336  </script>
337
338 
339 
340   
341   
342
343</body>
344</html>
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG