[fpc-devel] Parallel Computing
Florian Klaempfl
florian at freepascal.org
Mon Nov 3 16:17:35 CET 2008
Daniƫl Mantione schrieb:
>
>
> Op Mon, 3 Nov 2008, schreef Florian Klaempfl:
>
>> Michael Schnell schrieb:
>>> IMHO any technology that enables FPC to compile a loop like (using
>>> Oxygen syntax):
>>>
>>> for parallel i := 0 to 10 do begin
>>> a[i] := a[i] + b[i];
>>> end;
>>>
>>> in a way that it on a multicore processor runs as fast as the
>>> appropriate GNU C construct:
>>>
>>> #pragma ocm_parallel for
>>> for (i=0; i<=10; i++) {
>>> a[i] = a[i] + b[i];
>>> };
>>>
>>> would be fine.
>>
>> 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.
>>
>> Nice toy example without any real use.
>
> While I largely agree with you, it's nice to show some numbers.
Well, those tests even don't take care of thread starting time :) Taking
advantage of MT requires always deep knowledge about the used
architecture and the code being executed and this is something OpenMP
ignores. For a big vector operation the number of used threads should be
adapted to the memory architecture, for computational intensive
applications like Mandelbrot the number of threads must be adapted to
the number of available virtual cores.
More information about the fpc-devel
mailing list