[Q-e-developers] Parsing wall time, bug with fixed width?

Blair Lebert Blair.Lebert at impmc.upmc.fr
Wed May 27 12:03:27 CEST 2015


Hello,

I found a very small 'bug' with the output of the computation time. I
wanted to parse multiple files to get the their wall time. I thought it was
fixed width but as seen below the times without minutes at the top are all
shifted by one space. Also using fields to grab the data is also
troublesome since a space is put between minutes and seconds when the
seconds are less than 10 (highlight in red)

[image: Inline image 2]

One (probably poor) way of grabbing the wall time isn't very
straight-forward:
line=`grep PWSCF Fe.scf.out_s${s}_k${k} | tail -n 1`
minutes=`echo $line | sed 's/.*CPU //g' | egrep -o "[0-9]*m" | tr -d m`
seconds=`echo $line | sed 's/.*CPU //g' | egrep -o "[0-9]*\.[0-9]*s" | tr
-d s`
t=`echo "${minutes:-0}*60 + $seconds" | bc`


Cheers,
Blair
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20150527/ee4fb60e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PWSCF_fixed.png
Type: image/png
Size: 12581 bytes
Desc: not available
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20150527/ee4fb60e/attachment.png>


More information about the developers mailing list