From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eba2c26567dc4074 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: parallel programming Date: 1998/12/01 Message-ID: <7412a0$hvb$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 417482991 References: <3663BCDF.E05A1B16@est.it> X-Http-Proxy: 1.0 x11.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Dec 01 15:34:25 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1998-12-01T00:00:00+00:00 List-Id: In article <3663BCDF.E05A1B16@est.it>, pumilia@est.it wrote: > I plan to set up a libc6 based linux box with two processors on > the mainboard to speed up the execution of cyclic fortran routines. > I am currenlty involved with dynamilcal simulations in statistical > physics where two or more do-loops are nested together and executed a > very large number of times. ... > Since i will not buy a commercial fortran compiler, i am exploring the > possibility to translate to ada (the gnat gpl'd version) my routines > to get a parallel code. > My question is: > - will ada programs, given appropriate directives, run in parallel > on a two processor pc intel machine, provided that that the linux > kernel as been compiled setting SMP=1 in the makefile? It sounds like what you are looking for is some kind of High Performance Fortran-like functionality in Ada. Not that it isn't possible, but I know of no Ada compiler that will implicilty parallelize sequential code for you. Ada has no equivalent of the "dopar"-type explicitly parallel looping constructs of HPF. To get the benifits of parallel execution in Ada, you will probably have to write the loop in an Ada task type, create two of those tasks, and split the input data between them yourself. Its not really as hard as it sounds, but it does require you to learn a smidge about Ada tasks. For that to actually execute in parallel, your Ada compiler will have to put those tasks in separte OS threads (which Gnat will do), and your OS will have to be able to run separte threads on separate processors (I don't know if Linux does this). The *good* news is that Ada's strong typing rules allow compilers to optimize much better than a Fortran compiler can with the same amount of work. Gnat itself probably doesn't optmize any better or worse that the gnu-based Fortran though, since they both share the same back-end. It occurrs to me that extending Gnat with "for" loop pragmas for the 3 parallel looping constructs of HPF would be a great reasearch project for a graduate student... -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own