Analyzers
Community support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
4819 Discussions

Confusion on Summary of Ellapsed Time

KK1
Beginner
254 Views

When I profile my code, the summary had shown the elapsed time value (1283.389) and the subset of CPU Time value is (3685.21).  So, the CPU time should be smaller than the elapsed time.  If not, what is the cpu time included?  

0 Kudos
1 Solution
Peter_W_Intel
Employee
254 Views

Elapsed time is approximated to execution time, a little overhead from VTune.

If your program is serial, Elapsed time = CPU time (single thread).

As I said previous post, if your program is multiple threads, CPU time includes all time spent on different threads (cores) - they are parallel. Is it hard to understand? For example :

                T1        T2        T3        T4

Thread1   1          1          1           1 

Thread2               1          1

Thread3                           1           1

Elapsed time = 4

CPU time = 4+2+2 = 8

View solution in original post

4 Replies
Peter_W_Intel
Employee
254 Views

CPU time = summary of CPU time on cores/threads.

Please consider parallelism when profiling multithreaded application. 

KK1
Beginner
254 Views

If I run the code without VTune from the terminal, it takes only ~18 minutes.  This timing is closed to "elapsed time", but it is about ~3 minutes extra, which executing in VTune environment.  I'm still not sure what is "CPU time", the time specifies much more (61 minutes).  

It is a big different comparing 18 minutes vs 61 minutes.

Peter_W_Intel
Employee
255 Views

Elapsed time is approximated to execution time, a little overhead from VTune.

If your program is serial, Elapsed time = CPU time (single thread).

As I said previous post, if your program is multiple threads, CPU time includes all time spent on different threads (cores) - they are parallel. Is it hard to understand? For example :

                T1        T2        T3        T4

Thread1   1          1          1           1 

Thread2               1          1

Thread3                           1           1

Elapsed time = 4

CPU time = 4+2+2 = 8

KK1
Beginner
254 Views

Great. It is clear now. Thank you.

Reply