Hello,
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:
for (r = 1; r <= 1000; r++)
{
...some operations 0
#pragma omp parallel
#pragma omp sections
{
#pragma omp section
{
...some operations 1...
}
#pragma omp section
{
...some operations 2...
}
}
}
Interesting is that I found that when I put command Sleep(100) into the first and second section the code is faster with omp support than without it:
for (r = 1; r <= 1000; r++)
{
...some operations 0
#pragma omp parallel
#pragma omp sections
{
#pragma omp section
{
Sleep(100);
...some operations 1...
}
#pragma omp section
{
Sleep(100);
...some operations 2...
}
}
}
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
