GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
This page in English

Mail #10038

Zurück zur Archiv-Hauptseite

Vorige Mail   Nächste Mail   Unformatiert/Volle Header
Übersicht  10 Tage   Betreff   Datum   Thread   Autor  

Von: Grant Jacobs
Betreff: multiprocessor use w/ GPC compiled program (OT?)
Datum: 30.3.2004, 08:14:07


Just quickly - IMO this isn't really a Pascal Q so much as a program 
design Q (assuming there are no bizzare issues in threading with 
GPC!). You'll want your threads to have little data exchange or 
dependence on one another, or they'll either bottleneck over the data 
bus (MP programs can be come data bus bound rather than CPU bound, in 
principle at least; some folks claim this is an issue on the dual 
G5's)  or end up waiting on completion of another thread (blocked) in 
order to proceed. Its possible what you describe is blocking a big 
way. You'll have to think about how your code is designed to 
understand its behaviour and to make good use of both CPUs. Just 
sticking in threads won't automatically give you a say a 1.5X speed 
gain.

Since you're doing array work, I presume you've looked into making 
the code use the vector processor instructions on the G4/G5? That 
could you give you bigger gains than the threading. If you're not 
already on it, look on the scitech mailing list at Apple for further 
ideas/discussions. Look out for Ian Ollman's posts in particular.

Have fun,

Grant

At 9:16 PM +0200 29/3/04, Boris Herman wrote:
>Hi list,
>
>I have compiled a single-threaded (and quite non MP aware) pascal 
>program that does a lot of numerical computations. One calculation 
>takes about 5 days on my 1.25 GHz DDR G4 (single cpu) and I need 
>about 200 computations to do. Well, when I run the program on my G4 
>it takes up all CPU time (cca 93%-95%). I thought of speeding the 
>whole thing by running it on a dual processor machine so I got 
>someone to run it on a dual 2 GHz G5. So here comes the problem. If 
>only one instance is run on a dual G5 the Activity monitor shows 50% 
>CPU load (which is understandable) but the graph alternates between 
>100% load on 1st CPU and 100% load on 2nd CPU. I thought that is an 
>anomaly of Activity Monitor. However, when two instances are run, 
>the time required to execute each task doubles even though the 
>Activity monitor shows both cpus at 100% load.
>
>My program doesn't really do anything much - it performs gazillions 
>of computations in arrays that all together consume less than 20 Mb 
>of memory.
>
>Am I doing anything wrong or shouldn't I expect better performance 
>on a dual cpu unit?
>
>Highest regards,
>Boris

Vorige Mail   Nächste Mail   Unformatiert/Volle Header
Übersicht  10 Tage   Betreff   Datum   Thread   Autor  


Antwort auf

Autor Betreff Datum
Boris Herman multiprocessor use w/ GPC compiled program (OT?) 29.3.2004, 21:16:23

Zurück zur Archiv-Hauptseite


Hinweis: Diese Seite enthält Informationen, die nicht vom Betreiber dieser Website, sondern von den Autoren der archivierten Mails stammen. Der Betreiber dieser Website ist nicht für den Inhalt dieser Informationen verantwortlich. Die weitere Verwendung dieser Informationen bedarf des Einverständnisses des jeweiligen Autors.

Sofern WWW-Adressen (URLs) in den archivierten Mails als Hyperlinks hervorgehoben werden, so geschieht dies ausschließlich zur Annehmlichkeit für den Leser. Der Inhalt der auf diese Weise angelinkten Webseiten spiegelt nicht notwendigerweise die Meinung des Betreibers dieser Webseite oder der Autoren der archivierten Mails wider. Der Betreiber dieser Webseite ist nicht für den Inhalt solcher Webseiten verantwortlich. Diese Seiten sind ausdrücklich nicht als Teil des Inhalts dieser Seite zu betrachten, sondern lediglich als Referenzen.


Diese Seite wurde erzeugt von Crystal 0.999 (Linux 2.4.27/i686).