OpenCMISS-Iron Internal API Documentation
|
Using the TAU API, it is very simple to profile a block of code. This involves placing a pair of calls around the code you want to profile. An example is given below.
In the case of OpenCMISS, pairs of #ifdef TAUPROF
and #endif
directives need to be added around every TAU call or group of TAU calls, so that the compiler knows to remove these if TAUPROF isnt set. An example of this is given below. An example of a profile start call in OpenCMISS can be found in CMISSInitialiseObj. Likewise, the corresponding profile stop call can be found in CMISSFinalise.
When calls are nested, a hierarchical structure forms and profile data can be view by viewing each phase as the sum of its child phases. However, be careful not to overlap these calls as this will cause errors within TAU. An example of this is given below.
About 150 calls of this format are currently present in OpenCMISS, but all scenarios have not been captured. If you encounter unallocated time (time allocated to the parent phase), this will likely be because functions you have used which have not been implemented with TAU and you will need to implement these types of TAU calls in these functions yourself (usually in opencmiss.f90).
Dynamic phases allow the user to embed loop counters in the phase name. This is useful if you want to compare time spent in each loop or time spent in a routine across each iteration. An example of this is given below. An example of this can be found in OpenCMISS in LaplaceEquation_FiniteElementCalculate.
TAU allows you to sample memory use at points within your code. Unfortunately, you can not label calls. This means that you can not view how your memory usage changes through your code. You can do this roughly however by just calling the memory tracking function once.
The memory information is found at the end of the pprof
output. Run pprof
in the same location you would run paraprof
as described in the Visualisation section.