<div  id="checking-job-creation">
<span id="index-0"></span><span id="id1"></span>
<div >
<div >The process of <a  href="/wiki/display/ECFLOW/Glossary#term-job-creation"><em >job creation</em></a> can be checked before the <a  href="/wiki/display/ECFLOW/Glossary#term-suite-definition"><em >suite definition</em></a></div>
<div >is loaded into the <a  href="/wiki/display/ECFLOW/Glossary#term-ecflow-server"><em >ecflow_server</em></a>. The following checks are done:</div>
</div>
<ul >
<li>Locating <a  href="/wiki/display/ECFLOW/Glossary#term-ecf-script"><em >ecf script</em></a> files, corresponding to the <a  href="/wiki/display/ECFLOW/Glossary#term-task"><em >task</em></a> in the <a  href="/wiki/display/ECFLOW/Glossary#term-suite-definition"><em >suite definition</em></a></li>
<li>Performing <a  href="/wiki/display/ECFLOW/Glossary#term-pre-processing"><em >pre-processing</em></a></li>
</ul>
<div >
<div >When the <a  href="/wiki/display/ECFLOW/Glossary#term-suite-definition"><em >suite definition</em></a> is large and has many <a  href="/wiki/display/ECFLOW/Glossary#term-ecf-script"><em >ecf script</em></a> this</div>
<div >checking can save a lot of time.</div>
</div>
<p>Checking is done using <tt ><span >ecflow.Defs.check_job_creation</span></tt></p>
<div ><div ><pre><span >#!/usr/bin/env python2.5</span>
<span >import</span> <span >os</span>
<span >import</span> <span >ecflow</span> 
   
<span >defs</span> <span >=</span> <span >ecflow</span><span >.</span><span >Defs</span><span >()</span>
<span >suite</span> <span >=</span> <span >defs</span><span >.</span><span >add_suite</span><span >(</span><span >&quot;test&quot;</span><span >)</span>
<span >suite</span><span >.</span><span >add_variable</span><span >(</span><span >&quot;ECF_HOME&quot;</span><span >,</span><span >os</span><span >.</span><span >getenv</span><span >(</span><span >&quot;HOME&quot;</span><span >)</span> <span >+</span> <span >&quot;/course&quot;</span><span >)</span>
<span >suite</span><span >.</span><span >add_task</span><span >(</span><span >&quot;t1&quot;</span><span >)</span>

<span >#</span>
<span ># Check .ecf --&gt; .job  </span>
<span >#</span>
<span >job_ctrl</span> <span >=</span> <span >ecflow</span><span >.</span><span >JobCreationCtrl</span><span >()</span>                    
<span >defs</span><span >.</span><span >check_job_creation</span><span >(</span><span >job_ctrl</span><span >)</span>
<span >print</span> <span >job_ctrl</span><span >.</span><span >get_error_msg</span><span >()</span>

<span ># We can assert, so that we only progress, once all job creation works</span>
<span ># assert len(job_ctrl.get_error_msg()) == 0, job_ctrl.get_error_msg()</span>
</pre></div>
</div>
<p>What to do:</p>
<ol >
<li>Add job creation checking.</li>
</ol>
</div>