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?

Re: Question about omp_get_wtime

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

you get two times 5 for the two threads.

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

Return to Using OpenMP - The Book and Examples

Who is online

Users browsing this forum: No registered users and 1 guest