<div class="section" id="header-files-migration"> <span id="header-files"></span><span id="index-0"></span> <p>In our main operational suite, 9 files, out of 115, need modification, and 118 out of 932, amongst all suites.</p> <p>Many header files are a snapshot of old versions of the main header files, used to setup stand alone projects. This migration can be an opportunity to converge toward a common configuration file set.</p> <p>We also found that similar code was replicated amongst multiple files. This leads to “code cleaning” and factorisation.</p> <ul> <li><p class="first">We have the main configuration variables defined in our trap.h header file:</p> <div class="highlight-python"><pre>SMSNODE=%SMSNODE% SMS_PROG=%SMS_PROG% SMSNAME=%SMSNAME% SMSPASS=%SMSPASS% SMSTRYNO=%SMSTRYNO% SMSRID=$(echo $QSUB_REQID | cut -f1 -d.) SMSHOSTFILE=$HOME/.smshostfile SMSJOBOUT=%SMSJOBOUT%</pre> </div> </li> <li><p class="first">synchronisation commands existed in the rcp.h header:</p> <div class="highlight-python"><pre>rcp %LOGDIR%%SMSNAME%.%SMSTRYNO% emos@%SMSNODE%:%SMSOUT%%SMSNAME%.%SMSTRYNO%</pre> </div> </li> <li><p class="first">queuing system directives had embedded SMS vairiable (qsub.h):</p> <div class="highlight-python"><div class="highlight"><pre><span class="c"># QSUB -o %LOGDIR%%SMSNAME%.%SMSTRYNO%</span> </pre></div> </div> </li> <li><p class="first">SMS child commands were called in few header files: trap.h (smsabort, smsinit) and endt.h (smscomplete)</p> </li> <li><p class="first">All SMS variable must be used with a default value (%SMSX:0%) to prevent ecFlow to complain when generating job file.</p> </li> <li><p class="first">we can then proceed to variables translation or include specific ecFlow header files.</p> </li> </ul> <div class="highlight-python"><pre>#!/bin/ksh export ECF_PORT=%ECF_PORT:0% set -a case $ECF_PORT in 0 ) echo sms world ;; * ) echo "ecf world" PATH=/usr/local/apps/ecflow/current/bin:$PATH ECF_NAME=%ECF_NAME:0% ECF_PASS=%ECF_PASS:0% ECF_NODE=%ECF_NODE:0% ECF_TRYNO=%ECF_TRYNO:0% ECF_HOSTFILE=$HOME/.ecfhostfile ECF_JOBOUT=%ECF_JOBOUT:0% export SMSNAME=$ECF_NAME # ifs requests SMSNAME to be defined for meter-event posting NO_SMS=1 NOSMS=1; # export ECF_DEBUG_CLIENT=1 ;; esac set +a </pre> </div> </div> |