runtime of functions

runtime of functions


I've got a question concerning the Comand Line Interface of Intel trace Analyzer. I want to evaluate the total-runtime of one function of a mpi-program. I know how to do this using the GUI, but I want to get the average runtime of about 20 runs of the MPI-program. So how can I "ungroup" (as it is called in the GUI-version) the functions in the CLI? At the moment I can only find out how long the programm in total was running...

Thank you in advance for an answer


publicaciones de 6 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Hi Bernard,

Looks like stftool (a part of ITAC package) could help you. You can use:
   stftool trace_name.stf --print-statistics  >trace_name.stats

This command generates summary information about all commands.
But, you need to get information about one tick duration and it means that you need to convert a trace and get CLKPERIOD value. You may use:
   xstftool trace_name.stf --print-statistics | grep CLKPERIOD

To get function index you may need to use:
   xstftool trace_name.stf --print-statistics | grep MPI_Alltoall

After that just try this out:
   grep " N:" trace_name.stats
where N is the index you got by the previous command (number after DEFSTATE)

Sure, you can use `xstftool trace_name.stf`which genereates human readable text file and you can easily parse it but be prepared that it may take a lot of time to generate output file and it may be huge.



Hello Dmitry,

Thank you very much for your answer! I tried to follow your hints, but didn't get the results I wanted to get. For example one function couldn't be found in the stats-file:

$ stftool sofi3D.stf --print-statistics > sofi3D.stats

$ xstftool sofi3D.stf --print-statistics | grep exchange_s
Writing tracefile -
entry for undefined statistics #1
DEFSAMPCLASS "Application:/home/ws/bi140/sofi3D_impi/src/exchange_s.c"
DEFACT 41 "Application:/home/ws/bi140/sofi3D_impi/src/exchange_s.c"
DEFSTATE 70 ACT "Application:/home/ws/bi140/sofi3D_impi/src/exchange_s.c:exchange_s"

$ grep "70:" sofi3D.stats

it retruns nothing. But I'm sure (and ITA tells me the same) that the function exchange_s was active. In addition to this I tried to evaluate a second function:

$ xstftool sofi3D.stf --print-statistics | grep exchange_v
Writing tracefile -
entry for undefined statistics #1
DEFSAMPCLASS "Application:/home/ws/bi140/sofi3D_impi/src/exchange_v.c"
DEFACT 40 "Application:/home/ws/bi140/sofi3D_impi/src/exchange_v.c"
DEFSTATE 71 ACT "Application:/home/ws/bi140/sofi3D_impi/src/exchange_v.c:exchange_v"

$ grep "71:" sofi3D.stats
INFO FUNCTION_PROFILE 14:571:1:32440320000:32440320000:32440320000:32440320000:32440320000:32440320000
INFO FUNCTION_PROFILE 12:571:1:32055296000:32055296000:32055296000:32055296000:32055296000:32055296000
INFO FUNCTION_PROFILE 10:571:1:31752192000:31752192000:31752192000:31752192000:31752192000:31752192000
INFO FUNCTION_PROFILE 8:571:1:35364864000:35364864000:35364864000:35364864000:35364864000:35364864000
INFO FUNCTION_PROFILE 6:571:1:27189248000:27189248000:27189248000:27189248000:27189248000:27189248000
INFO FUNCTION_PROFILE 4:571:1:27623424000:27623424000:27623424000:27623424000:27623424000:27623424000
INFO FUNCTION_PROFILE 2:571:1:26648576000:26648576000:26648576000:26648576000:26648576000:26648576000
INFO FUNCTION_PROFILE 0:571:1:10141696000:10141696000:10141696000:10141696000:10141696000:10141696000
INFO FUNCTION_PROFILE 15:571:1:32317440000:32317440000:32317440000:32317440000:32317440000:32317440000
INFO FUNCTION_PROFILE 13:571:1:32686080000:32686080000:32686080000:32686080000:32686080000:32686080000
INFO FUNCTION_PROFILE 11:571:1:31825920000:31825920000:31825920000:31825920000:31825920000:31825920000
INFO FUNCTION_PROFILE 9:571:1:33005568000:33005568000:33005568000:33005568000:33005568000:33005568000
INFO FUNCTION_PROFILE 7:571:1:26992640000:26992640000:26992640000:26992640000:26992640000:26992640000
INFO FUNCTION_PROFILE 5:571:1:27148288000:27148288000:27148288000:27148288000:27148288000:27148288000
INFO FUNCTION_PROFILE 3:571:1:27230208000:27230208000:27230208000:27230208000:27230208000:27230208000
INFO FUNCTION_PROFILE 1:571:1:28794880000:28794880000:28794880000:28794880000:28794880000:28794880000

This seems to be fine. But when I compared the results (CLKPERIOD=1.2207E-13) with the results I got using ITA I realized that there is a difference of 3,644683072E-005 s... Maybe this value is so small that ITA can't manage it (rounding error)? But the fact that the function-ID turns from 71 to 571 is a bit confusing to me. And what's about the function grep cant't fint in sofi3D.stats?

Best regards


Well, Bernard, you haven't mentioned that this is a non-mpi function. It doesn't have statistics information in the trace.

So, you should generate a text representation of the trace `xstftool sofi3D.stf > sofi3D.avt`
After that `grep exchange_s sofi3d.avt`.

I'm not familiar with user code investigation by ITAC but I hope that looking at the AVT file may give you a clue - just open it in a text viewer.

Yeah, 3e-5 is rather rounding error because each event has precision worse than 1e-6.



Hi Dmitry,

i tried this yesterday, but it wasn't very helpful. Now I decided not to evaluate the runtimes automaticly but using ITA instead. It will be a lot of stupid work exporting the "flat-data" again and again but it works.

Thank you anyway for your help. At a later point i have to evaluate the MPI-calls, so then your solution will save time :-)

Best regards


BTW, Bernhard,
Intel MPI has internal statistics. Just set I_MPI_STATS to a value from 1 to 10 and you can get some information (might be very difficult to ananlyze automatically). And there is 'ipm' value to produce an output in IPM-like format. Just give it a try and might you'll find it useful.


Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya