How to estimate time needed for "fork-join" process

General OpenMP discussion

How to estimate time needed for "fork-join" process

Postby VladimirProkopov » Tue Dec 04, 2007 10:55 am

Hello

Suppose that I have function func1(a,b), 2 processors (like Intel Core2Duo) and code, called about 1e20 times, that looks like:
Code: Select all
{
double t1=func(a,b);
double t2=func(b,c);
}


I can make this code parallel like this

Code: Select all
{
double t1=0,t2=0;
#pragma omp parallel sections
{
#pragma omp section
  t1=func(a,b);
#pragma omp section
  t2=func(b,c);
}
}


but I think that if my function is like this
Code: Select all
double func1(double a, double b)
{ return a+b; }

then I will get no speedup at all, because most of the time processor will make "fork-join" operations rather than actual work. Is it possible to estimate time needed for "fork-join" operations for latter comparison?
Is there any criterion saying that a function is "worth" parallelizing?

Thanks in advance
VladimirProkopov
 
Posts: 1
Joined: Tue Dec 04, 2007 3:17 am
Location: Russia, Moscow

Re: How to estimate time needed for "fork-join" process

Postby lfm » Fri Jan 18, 2008 8:13 pm

The EPCC microbenchmarks (google it) can help you estimate the time required for the various OpenMP constructs.
lfm
 
Posts: 135
Joined: Sun Oct 21, 2007 4:58 pm
Location: OpenMP ARB


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 9 guests

cron