Skip to content

timing ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourceCASTEP log
idtiming
nameCASTEP timing section
pattern\s*Initialisation\stime.*
endPattern\s*Peak\sMemory\sUse.*
endPattern2~
endOffset1
xml:basetiming.xml

Input ​

Initialisation time =      6.78 s
Calculation time    =      4.92 s
Finalisation time   =      0.06 s
Total time          =     11.76 s
Peak Memory Use     = 853140 kB

Output text ​

xml
<comment class="example.output" id="timing">
        <module cmlx:templateRef="timing">
            <scalar dataType="xsd:string" dictRef="ca:inittime" units="si:s">6.78</scalar>
            <scalar dataType="xsd:string" dictRef="ca:calctime" units="si:s">4.92</scalar>
            <scalar dataType="xsd:string" dictRef="ca:endtime" units="si:s">0.06</scalar>
            <scalar dataType="xsd:string" dictRef="cc:wallTtime" units="si:s">11.76</scalar>
            <scalar dataType="xsd:integer" dictRef="ca:peakmem" units="nonsi2:kilobyte">853140</scalar>
        </module>    
    </comment>

Template definition ​

xml
<record>\s*Initialisation\stime\s*=&#123;A,ca:inittime&#125;s\s*</record>
<record>\s*Calculation\stime\s*=&#123;A,ca:calctime&#125;s\s*</record>
<record>\s*Finalisation\stime\s*=&#123;A,ca:endtime&#125;s\s*</record>
<record>\s*Total\stime\s*=&#123;A,cc:wallTtime&#125;s\s*</record>
<record>\s*Peak\sMemory\sUse\s*=&#123;I,ca:peakmem&#125;.*</record>
<transform process="pullup" xpath=".//cml:scalar" />
<transform process="delete" xpath=".//cml:list" />
<transform process="addUnits" xpath=".//cml:scalar[not(@dictRef='ca:peakmem')]" value="si:s" />
<transform process="addUnits" xpath=".//cml:scalar[@dictRef='ca:peakmem']" value="nonsi2:kilobyte" />