OpenMP® Forum

Discussion on the OpenMP specification run by the OpenMP ARB. OpenMP and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board in the United States and other countries. All rights reserved.

I wrote a code that simulates the physical processes in the semiconductors. The simulation requires long computation time so I was looking for some way to accelerate the code. I found that two blocks of the code can be performed in parallel.Unfortunately there is no acceleration with omp support activated. Additionally the program works longer than without omp support. The code has a structure similar to the following:

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.Andriej

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.

Hi Andriej,

Can you estimate the length of time taken by the computation inside the parallel region? The overhead of a parallel region is typically in the tens to hundreds of microseconds range. If the code you are trying to parallelise takes less time than this, then there is pretty much no hope!

Note that the most guarantee way to measure time is OMP_GET_WTIME(). The other ones adds up the timing results of all threads...One important issue is that you should use float kind for timers, and you can multiply the time by a constant, e.g. 1000, and report times in milliseconds, but if the work is not so much time consuming the reported times may be wrong. You can also try: >> time run.exe to compare the timings...