home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ornl!sunova!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!caen!umeecs!umn.edu!lynx!zia.aoc.nrao.edu!laphroaig!cflatter
- From: cflatter@nrao.edu (Chris Flatters)
- Subject: Re: Reasons for using C vs. Fortran or vic
- Message-ID: <1992Nov15.231311.20440@zia.aoc.nrao.edu>
- Sender: news@zia.aoc.nrao.edu
- Reply-To: cflatter@nrao.edu
- Organization: NRAO
- References: <1992Nov15.201555.20678@thunder.mcrcim.mcgill.edu>
- Date: Sun, 15 Nov 92 23:13:11 GMT
- Lines: 36
-
- In article 20678@thunder.mcrcim.mcgill.edu, mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
- >In article <1992Nov13.162451.13049@zia.aoc.nrao.edu>, cflatter@nrao.edu (Chris Flatters) writes:
- >
- >> Storing arrays by column or by row doesn't make any difference
- >> whatsoever to the speed of matrix operations: it is merely a notation
- >> change.
- >
- >This is true only in the abstract. I have experienced (not just heard
- >about) multiple orders of magnitude speed differences, because going
- >through arrays "the wrong way" had catastrohpically bad VM behavior:
- >essentially, every access involved a page fault. Doing it "the right
- >way" stepped through VM in a nice sequential way, with minimal paging.
-
- This is true. The cost of moving data around is often higher than the cost
- of computation. Generally speaking you want to keep accesses that are close
- together in time close together in memory: VM isn't the only constraint ---
- you make the most out of modern RISC machines by working in cache as much as
- possible.
-
- Storing arrays by column or row doesn't actually make much difference here
- (although not knowing which convention you are using can hurt you). For
- large linear algebra problems blocked algorithms (as used in LAPACK) are
- the methods of choice (see, for example "Solving Linear Systems on
- Vector and Shared Memory Computers" by Jack Dongarra and several others
- (SIAM, 1991)).
-
-
- > der Mouse
- ^^^
-
- Like Matthias Blume, I've always been curious about this.
-
- Chris Flatters
- cflatter@nrao.edu
-
-
-