[fpc-devel] Parallel Computing
Mattias Gaertner
nc-gaertnma at netcologne.de
Mon Nov 3 20:18:59 CET 2008
On Mon, 03 Nov 2008 16:29:01 +0100
Michael Schnell <mschnell at lumino.de> wrote:
>
> > Great and you really believe this accelerates a program? Starting a
> > thread takes a lot of time and such loops are usually memory
> > throughput bound.
> >
> OK, I should not have used 10 as the element but 1000000 :). And of
> course it makes more sense if a more complex calculation is to be
> done in each loop. But exactly this issue (lots of independent
> calculations in parallel) is a widely seen task (e.g points in
> physical fields).
>
> Of course the RTL is not supposed to start a thread for each of the
> loop runs but assign a number of them to a couple of threads.
I just completed another example, where threads helped less than
expected:
A program that loads tiff images (about 60mb each), resizes and apply
some filters to them, then saves them. The disk io makes less than 10%
of the time. The filters are mostly simple loops - perfect for OpenMP.
There is almost no speed difference from one thread or two threads on
a two core machine. :(
I will soon test on a 2 x quad core with 8 threads.
Mattias
More information about the fpc-devel
mailing list