Skip to content

timing ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourcexTB log
idtiming
nameTimings
pattern\s*\-+\s*$\s*\*\s*finished\s*run\s*on.*
endPattern\s*
endPattern2~
endOffset1
xml:basetimings.xml

Input

------------------------------------------------------------------------
 * finished run on 2025/03/31 at 18:25:24.884     
------------------------------------------------------------------------
 total:
 * wall-time:     0 d,  0 h,  0 min,  0.030 sec
 *  cpu-time:     0 d,  0 h,  0 min,  0.055 sec
 * ratio c/w:     1.865 speedup
 SCF:
 * wall-time:     0 d,  0 h,  0 min,  0.013 sec
 *  cpu-time:     0 d,  0 h,  0 min,  0.030 sec
 * ratio c/w:     2.385 speedup

Output text

xml
<comment class="example.output" id="timing">
        <module cmlx:templateRef="timing" dictRef="cc:userDefinedModule">
            <scalar dataType="xsd:date" dictRef="cc:dateEnd">2025-02-28T12:51:13.691</scalar>
            <scalar dictRef="cc:walltime" units="si:s">0.075</scalar>
            <scalar dictRef="cc:cputime" units="si:s">0.239</scalar>
        </module>
    </comment>

Template definition

xml
<record />
<record>\s*\*\s*finished\s*run\s*on\s*&#123;X,cc:dateEnd&#125;</record>
<record repeat="2" />
<record id="walltime">\s*\*\s*wall-time:&#123;F,x:day&#125;\s*d\s*,&#123;F,x:hour&#125;\s*h\s*,&#123;F,x:min&#125;\s*min\s*,&#123;F,x:second&#125;\s*sec</record>
<record id="cputime">\s*\*\s*cpu-time:&#123;F,x:day&#125;\s*d\s*,&#123;F,x:hour&#125;\s*h\s*,&#123;F,x:min&#125;\s*min\s*,&#123;F,x:second&#125;\s*sec</record>
<transform process="pullup" xpath=".//cml:scalar" />
<transform process="addChild" xpath="." elementName="cml:scalar" dictRef="cc:walltime" />
<transform process="setValue" xpath=".//cml:scalar[@dictRef='cc:walltime']" value="$number( (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:day']/text() * 86400) +                                                                                                 (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:hour']/text() * 360) +                                                                                                  (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:min']/text() * 60) +                                                                                                  (//cml:list[@cmlx:templateRef='walltime']//cml:scalar[@dictRef='x:second']/text()))" />
<transform process="addChild" xpath="." elementName="cml:scalar" dictRef="cc:cputime" />
<transform process="setValue" xpath=".//cml:scalar[@dictRef='cc:cputime']" value="$number( (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:day']/text() * 86400) +                                                                                                 (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:hour']/text() * 360) +                                                                                                  (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:min']/text() * 60) +                                                                                                  (//cml:list[@cmlx:templateRef='cputime']//cml:scalar[@dictRef='x:second']/text()))" />
<transform process="addUnits" xpath=".//cml:scalar[@dictRef='cc:walltime']" value="si:s" />
<transform process="addUnits" xpath=".//cml:scalar[@dictRef='cc:cputime']" value="si:s" />
<transform process="createDate" xpath=".//cml:scalar[@dictRef='cc:dateEnd']" format="yyyy/MM/dd 'at' HH:mm:ss.SSS" />
<transform process="delete" xpath=".//cml:list" />