Community
cancel
Showing results for 
Search instead for 
Did you mean: 
KK1
Beginner
37 Views

Confusion on Summary of Ellapsed Time

Jump to solution

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
37 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
37 Views

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

Please consider parallelism when profiling multithreaded application. 

KK1
Beginner
37 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
38 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

KK1
Beginner
37 Views

Great. It is clear now. Thank you.

Reply