The attached patch to Carpet adds a parameter (off by default) which outputs the timer tree from each process to an XML file in the output directory at the end of the run. The output looks like this:
<timer name = "main"> 7.7702 <timer name = "CallFunction"> 0.000241 <timer name = "thorns"> 0.000233 <timer name = "CaKernel_FreeDevMem"> 0.000221 <timer name = "PostCall"> 2e-06 </timer> <timer name = "PreCall"> 1e-06 </timer> </timer> </timer> </timer> <timer name = "CarpetStartup"> 0.00982 <timer name = "AllocateGridHierarchy"> 5e-06 </timer>
An alternative schema would be to have the name and timer value as subelements; i.e.
<timer> <name>main</name> <value>7.7702</value> <children> <timer> <name>CallFunction</name> <value<0.000241</name> ... </timer>
The <children> tag might not be necessary, but might make it easier to parse. Having one file per process is not ideal; we would like to add reductions across processes to give min, max, average, standard deviation etc, also for the standard output display.
OK to commit as a work-in-progress? We can change the schema later if it turns out to be easier to deal with.