[Omp] slow performance
andrew wang
mcwang88 at hotmail.com
Sun Dec 26 18:50:04 PST 2004
Hi Tan,
Sorry for late response, I was on holiday these few days.
Yes. I think we solve the problem.
First, in the test program, I put too little work in each loop, that's why
most of time is spent on fork/join, end up no time saving. But in my real
program, I definitely have much much enough work to do in each loop, so
these should be not a issue.
Second, as pointed out by Alexander Spiegel, I should declare "id" variable
as thread private, this really help a lot, although I am still not fully
understand that yet, anyway thanks Alex!
Actually I am trying to parallelize a Genetic Algorithm, I have full sorce
code, no need any external library.
Regarding the hardware, i have not much info, it belong to a research center
of the school.
For intel compiler, here is my command:
icl /Qopenmp main.c
Thanks everyone for your help, really suprise we have so big community with
OpenMP, that's great!
Andrew
>From: C J Kenneth Tan -- OptimaNumerics <cjtan at OptimaNumerics.com>
>To: andrew wang <mcwang88 at hotmail.com>
>Subject: Re: [Omp] slow performance
>Date: Tue, 21 Dec 2004 14:02:49 +0000 (UTC)
>
>Andrew,
>
>What's your current status with this? I am sorry, I didn't manage to
>follow the entire thread of messages.
>
>What kind of application are you trying to parallelize using OpenMP?
>Does the program depend on any external libraries?
>
> > Compaq AlphaServer SC45 with 44 nodes, each node comprising of four 1GHz
>Alpha
> > processors with 1GB memory. I am uing only one node with different
>thread
> > number (1-3). Compaq C compiler supports openmp spe 1.0. The os should
>be true
> > 64 Unix.
>
>How much longer are you planning to keep this machine running? This
>machine is getting old.
>
> > I also try to compile same program on Intel C compiler 8.0, and run it
>on two
> > processor win2k server. Here is the running result:
> >
> > D:\omp\test>try 2
> > omp_get_num_procs=2
> > Parallel region time=12 seconds
> > Total time = 14 seconds
> > D:\omp\test>try 1
> > omp_get_num_procs=2
> > Parallel region time=12 seconds
> > Total time = 14 seconds
> >
> > seems there is not much difference, same problem.
>
>What options did you use with icc8.0?
>
> > As somebody point out, my program actually do not much inside parallel
>region,
> > so i increase the inner loop from 50->500,
> >
> > ...
> > for (kk=0; kk< 500; kk ++){
> >
> >
> > x = (kk+0.5)*step;
> > sum += 4.0/(1.0+x*x); // more complicated calculation here.
> > }
> > ...
> >
> >
> > here is the result:
> >
> >
> > d:\omp\test>try 1
> > omp_get_num_procs=2
> > Parallel region time=83 seconds
> > Total time = 87 seconds
> >
> > D:\omp\test>try 2
> > omp_get_num_procs=2
> > Parallel region time=66 seconds
> > Total time = 66 seconds
> >
> > So the perfromance got enhanced for 2 threads. If this is the case, how
>should
> > I parallelize such program? Because in my real program, I can only
>parallize
> > the particular region only.
>
>Time reduction of approx 25% with 2 threads is not very attractive.
>But this info may not mean much at all, when you take into account
>your real code.
>
>
>Ken
>-----------------------------------------------------------------------
>News: OptimaNumerics Powers Russia's Fastest Supercomputer
>-----------------------------------------------------------------------
>C. J. Kenneth Tan, Ph.D.
>OptimaNumerics Ltd.
>E-mail: cjtan at OptimaNumerics.com Telephone: +44 798 941 7838
>Web: http://www.OptimaNumerics.com Facsimile: +44 289 066 3015
>-----------------------------------------------------------------------
>This e-mail (and any attachments) is confidential and privileged. It
>is intended only for the addressee(s) stated above. If you are not an
>addressee, please accept my apologies and please do not use,
>disseminate, disclose, copy, publish or distribute information in this
>e-mail nor take any action through knowledge of its contents: to do so
>is strictly prohibited and may be unlawful. Please inform me that
>this e-mail has gone astray, and delete this e-mail from your system.
>Thank you for your co-operation.
>-----------------------------------------------------------------------
>
>
>
More information about the Omp
mailing list