when I put command Sleep(100) into the first and second section the code is faster with omp support than without it
andriejz wrote:Intuition tells me that perhaps the initiation of the parallel areas takes more time than operations in sections 1 and 2.
Is there possibility to obtain to faster code in case of my code ?
I'll be grateful for any help.
ftinetti wrote:How are you measuring runtime? I suggest you use omp_get_wtime()
means an active wait policy (i.e. spin lock/s). You can verify this guess changing the sleep(100) at the end of each section instead of its current place. Or, directly, set OMP_WAIT_POLICY to passive.
I used clock_t from <time.h>
Unfortunately I use Visual Studio whit openmp 2.0 and according to my knowladge OMP_WAIT_PPOLICY is not supported by it.
ftinetti wrote:Please use omp_get_wtime() and report what you obtain.
Well... OMP_WAIT_PPOLICY is an environment variable, so you should be able to set it.
Users browsing this forum: Majestic-12 [Bot] and 5 guests