Re: Language efficiency of C versus FORTRAN et al
From: Gregory Toomey (nospam_at_bigpond.com)
Date: 12/27/04
- Next message: Gregory Toomey: "Re: Problem regarding sum of digits of floating point number in C"
- Previous message: Tim Prince: "Re: Language efficiency of C versus FORTRAN et al"
- In reply to: travisperkins03_at_hotmail.com: "Language efficiency of C versus FORTRAN et al"
- Next in thread: Chris Torek: "Re: Language efficiency of C versus FORTRAN et al"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 27 Dec 2004 13:23:54 +1000
travisperkins03@hotmail.com wrote:
> Hi,
>
> I have read somewhere that C code sometimes cannot be compiled to be as
> efficient as FORTRAN, eg for matrix multiplication, because a C
> compiler cannot make the assumptions about arrays that a FORTRAN
> compiler can. But I don't understand the example, not least because I
> don't understand FORTRAN. I also don't understand why it is more
> efficient in this case for a compiler to choose the order of evaluation
> (or whatever it is that it does for matrix multiplication to make it
> faster).
>
> Can anyone explain all this, please? And how much speed-up might one
> get from using FORTRAN over C for such things? What sort of compilers
> offer the best performance for issues like this? Is there any general
> advice about how to achieve efficient code for such linear algebra?
>
> This is a fairly live issue, because matrix mulitplication (and other
> things, like evaluating a dot product) often take an extremely long
> time for large matrices and vectors.
>
> I am also wondering how other languages like Pascal might compare to C
> and Fortran in this regard; does Pascal have enough array structure to
> allow compilers to take advantage of such optimisations?
>
> Any more general docs on issues like this would also be interesting
> reading.
>
> Thanks
Fortran compilers have been optimised for SIMD architectures eg Cray
supercomputers. They improve the speed of vector/matrix calculations.
I presume the same is now true for C matrix libraries on SIMD machines.
See http://en.wikipedia.org/wiki/SIMD
gtoomey
- Next message: Gregory Toomey: "Re: Problem regarding sum of digits of floating point number in C"
- Previous message: Tim Prince: "Re: Language efficiency of C versus FORTRAN et al"
- In reply to: travisperkins03_at_hotmail.com: "Language efficiency of C versus FORTRAN et al"
- Next in thread: Chris Torek: "Re: Language efficiency of C versus FORTRAN et al"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|