Question about omp_get_wtime

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the viewtopic.php?f=8&t=465 for book info and to download the examples. Post your feedback about the book and examples to this forum

Question about omp_get_wtime

Postby juaninf » Sun Aug 22, 2010 5:39 pm

in this function omp_get_wtime
For example if two treads A and B, A takes 5 and the other 5 and running at the same time, it will get 5 or 10?
juaninf
 
Posts: 10
Joined: Wed Aug 11, 2010 7:53 am

Re: Question about omp_get_wtime

Postby cswb625 » Thu Mar 03, 2011 2:01 pm

hello,
you get two times 5 for the two threads.
cswb625
 
Posts: 1
Joined: Thu Mar 03, 2011 1:59 pm

Re: Question about omp_get_wtime

Postby ruud » Tue Aug 09, 2011 7:31 pm

It all depends on how you use this function. The most common use is something like this:

Code: Select all
t_start = omp_get_wtime();
#pragma omp parallel
{
  .....
}
t_end = omp_get_wtime() - t_start;


That will give you the elapsed time of the parallel region.

Kind regards, Ruud
ruud
 
Posts: 23
Joined: Mon Nov 26, 2007 2:13 am


Return to Using OpenMP - The Book and Examples

Who is online

Users browsing this forum: No registered users and 3 guests