From: Andres Martinez Newsgroups: comp.lang.fortran,comp.parallel.pvm Subject: Re: fortran77 programming Date: Mon, 30 Nov 1998 03:45:10 -0800 Organization: CSUnet Message-Id: References: <3660D892.E1EDBF12@est.it> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <3660D892.E1EDBF12@est.it> Xref: ukc comp.lang.fortran:61834 comp.parallel.pvm:7830 On Sun, 29 Nov 1998, Paolo Pumilia wrote: > Hi all, > I plan to set up a libc6 based linux box with to 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 and executed a very > large number of times. > I run through parallel-processing howto but i need some quick hints, > since i am very new to this matter. > My first questions are: > - will my fortran77 programs, without any change, > run in parallel on a two processor machine, provided that kernel > as been compiled using SMP=1 in the makefile? No. The kernel will execute the program on one processor only. In order to execute the program on more than one processor, you need to makes changes to your code either manually or through a good compiler (one that costs $$$). > - Are there special directive to the g77 compiler that can be added > to my routines in order to get a better efficiency ? I personally am satisfied with the basic -O options but either way none of the options on g77 do automatic parallelization. > - Do you suggest to rewrite do-loops in a different language? > It depends on much you are willing to spend and your experience with Unix system programming. If you are a pure fortran77 programmer, you are better off buying a commercial compiler to assist in parallelizing your code. For instance, the fortran compilers at http://www.pgroup.com run on Linux and support the Open MP specification. With Open MP, you merely embed directives in your code to assist the compiler in parallelizing your code. Otherwise, you'll have to explicitly make modifications to your code. Whole books are written about this stuff but this is an option only if you're familiar with the Unix system calls and knowledgeable in C. Basically, you need to become familiar with the system functions, fork(), shmat(), shmget(), shmdt(), shmctl(), wait(), semat(), semctl, semdt() and others if multiple processes will be used or the functions found in the posix threads library if multiples threads will be used. All this must be done in C (unless you figure out to call them from fortran. One thorny point is that shmget(), the function to call when allocating shared memory returns addresses). > - When other programs are running together wth the dynamical > simulation, > will the linux kernel be able to distribute the load between the two > processor or one of them wil be overloaded? > Yes, the load will be distributed, although you'll get much better performance from the 2.2 series of kernels due out very soon (you can use the 2.1 development series in the mean time). SMP support in the 2.0.x series isn't complete (I don't think it wasn't very good in distributing loads). > > Finally, technical notes are welcome. My idea is to get two > celeron-intel > processors with shared memory and pci bus. What about heating of the > chipset, when cpu intensive applications are run for tens of hours? Can't help you here. I hope this is nothing to worry about. Generally, this is nothing to worry about unless you're assembling the computer yourself. It's preferable to buy the dual processor computer from a reputable place (for instance, http://www.varesearch.com). > > Thank you for your help > > Paolo Pumilia > > -- > --- CSTC > >