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 Jobscript compilejob.ksh — flex_extract 7.1 alpha 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 type="text/javascript" src="../../_static/jquery.js"></script> |
---|
25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
---|
26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
---|
27 | <script type="text/javascript" src="../../_static/language_data.js"></script> |
---|
28 | <script async="async" type="text/javascript" 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 - CONVERT2" 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 |
---|
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="../../installation.html">Installation</a></li> |
---|
93 | <li class="toctree-l1"><a class="reference internal" href="../../quick_start.html">Quick Start</a></li> |
---|
94 | <li class="toctree-l1"><a class="reference internal" href="../../ecmwf_data.html">ECMWF Data</a></li> |
---|
95 | <li class="toctree-l1 current"><a class="reference internal" href="../../documentation.html">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 & 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 Jobscript <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 - <code class="docutils literal notranslate"><span class="pre">CONVERT2</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 Jobscript <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 Coordinate</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> »</li> |
---|
171 | |
---|
172 | <li><a href="../../documentation.html">Documentation</a> »</li> |
---|
173 | |
---|
174 | <li><a href="../input.html">Control & Input Data</a> »</li> |
---|
175 | |
---|
176 | <li>The Compilation Jobscript <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-jobscript-compilejob-ksh"> |
---|
196 | <h1>The Compilation Jobscript <code class="docutils literal notranslate"><span class="pre">compilejob.ksh</span></code><a class="headerlink" href="#the-compilation-jobscript-compilejob-ksh" title="Permalink to this headline">¶</a></h1> |
---|
197 | <p>The compilejob 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">compilejob.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 |
---|
199 | the Korn-shell script from the template files by substituting the individual parameters. |
---|
200 | These 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">job.temp</span></code>.</p> |
---|
201 | <p>The jobscript has a number of settings for the batch system which are fixed and differentiates between the <em>ecgate</em> and the <em>cca/ccb</em> |
---|
202 | server 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>It sets necessary batch system parameters</li> |
---|
209 | <li>It prepares the job environment at the ECMWF servers by loading the necessary library modules</li> |
---|
210 | <li>It sets some environment variabels for the single session</li> |
---|
211 | <li>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</li> |
---|
212 | <li>It untars the tar-ball into the root directory.</li> |
---|
213 | <li>It compiles the Fortran programs’s <code class="docutils literal notranslate"><span class="pre">Makefile</span></code>.</li> |
---|
214 | <li>At the end it checks if the script returned an error or not and send the log file via email to the user.</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 eccodes |
---|
251 | module unload python |
---|
252 | module unload emos |
---|
253 | module load python3 |
---|
254 | module load eccodes/2.12.0 |
---|
255 | module load emos/455-r64 |
---|
256 | <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> |
---|
257 | <span class="nb">export</span> <span class="nv">MAKEFILE</span><span class="o">=</span>Makefile.gfortran |
---|
258 | <span class="p">;;</span> |
---|
259 | *cca*<span class="o">)</span> |
---|
260 | module unload python |
---|
261 | module switch PrgEnv-cray PrgEnv-intel |
---|
262 | module load python3 |
---|
263 | module load eccodes/2.12.0 |
---|
264 | module load emos |
---|
265 | <span class="nb">echo</span> <span class="si">${</span><span class="nv">GROUP</span><span class="si">}</span> |
---|
266 | <span class="nb">echo</span> <span class="si">${</span><span class="nv">HOME</span><span class="si">}</span> |
---|
267 | <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">'{print $1, $2, $3, $4}'</span> |
---|
268 | <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">'{print $4}'</span><span class="sb">`</span> |
---|
269 | <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> |
---|
270 | <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> |
---|
271 | <span class="nb">export</span> <span class="nv">MAKEFILE</span><span class="o">=</span>Makefile.gfortran |
---|
272 | <span class="p">;;</span> |
---|
273 | <span class="k">esac</span> |
---|
274 | |
---|
275 | mkdir -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> |
---|
276 | <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> |
---|
277 | tar -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 |
---|
278 | <span class="nb">cd</span> source/fortran |
---|
279 | <span class="se">\r</span>m *.o *.mod CONVERT2 |
---|
280 | make -f <span class="si">${</span><span class="nv">MAKEFILE</span><span class="si">}</span> >flexcompile <span class="m">2</span>>flexcompile |
---|
281 | |
---|
282 | ls -l CONVERT2 >>flexcompile |
---|
283 | <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> |
---|
284 | <span class="nb">echo</span> <span class="s1">'SUCCESS!'</span> >>flexcompile |
---|
285 | 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> <flexcompile |
---|
286 | <span class="k">else</span> |
---|
287 | <span class="nb">echo</span> Environment: >>flexcompile |
---|
288 | env >> flexcompile |
---|
289 | mail -s <span class="s2">"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">"</span> <span class="si">${</span><span class="nv">USER</span><span class="si">}</span> <flexcompile |
---|
290 | <span class="k">fi</span> |
---|
291 | </pre></div> |
---|
292 | </div> |
---|
293 | <div class="toctree-wrapper compound"> |
---|
294 | </div> |
---|
295 | </div> |
---|
296 | </div> |
---|
297 | |
---|
298 | |
---|
299 | </div> |
---|
300 | |
---|
301 | </div> |
---|
302 | <footer> |
---|
303 | |
---|
304 | <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> |
---|
305 | |
---|
306 | <a href="fortran_makefile.html" class="btn btn-neutral float-right" title="The Fortran Makefile - CONVERT2" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> |
---|
307 | |
---|
308 | |
---|
309 | <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> |
---|
310 | |
---|
311 | </div> |
---|
312 | |
---|
313 | |
---|
314 | <hr/> |
---|
315 | |
---|
316 | <div role="contentinfo"> |
---|
317 | <p> |
---|
318 | © Copyright 2019, Anne Philipp and Leopold Haimberger |
---|
319 | |
---|
320 | </p> |
---|
321 | </div> |
---|
322 | 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>. |
---|
323 | |
---|
324 | </footer> |
---|
325 | |
---|
326 | </div> |
---|
327 | </div> |
---|
328 | |
---|
329 | </section> |
---|
330 | |
---|
331 | </div> |
---|
332 | |
---|
333 | |
---|
334 | |
---|
335 | <script type="text/javascript"> |
---|
336 | jQuery(function () { |
---|
337 | SphinxRtdTheme.Navigation.enable(true); |
---|
338 | }); |
---|
339 | </script> |
---|
340 | |
---|
341 | |
---|
342 | |
---|
343 | |
---|
344 | |
---|
345 | |
---|
346 | </body> |
---|
347 | </html> |
---|