Fortran vc. C for numerical work 
Author Message
 Fortran vc. C for numerical work


>>     With respect to speed, almost all machines that I have used during
>>     the last 25 or so years have had faster multiplications than
>>     memory accesses.

>Hmmm. What machines do you use? In my experience (mostly mainframes and
>supers, some micros, and only recently a bit with minis) local memory
>access is up to several times as fast as integer multiplication. (I
>don't like this situation; converting to floating point just to multiply
>quickly on a Cray seems rather silly.)

I do not know where you get your information.  If memory access was faster
than multiplication, then there would be not need for all kinds of
cache!  For your information, memory access on Cray Y-MP takes 4 cycles
whereas multiplication takes only one cycle.  The use of 64 memory banks
is aimed to address memory access problem; otherwise, the pipeline will
not be filled and the machine will not achieve one result per cycle.

>>     Anyway, Dan's answer points out the performance differences in the
>>     array versus pointer access stuff. Personally I just don't user
>>     pointers much because my problems don't call for them. If I had to
>>     access multi-dimensional arrays in random fashion very often, the
>>     pointer solution might be acceptable.

>But you really do access random spots in arrays; it's a rare problem
>that always starts from the top left corner of every matrix. Take a
>typical pivot-based algorithm, for instance: you're dealing with
>essentially random rows at each step.

But once you have fixed on one row, the elements of this row will be
accessed sequentially.  The question really is: how much overhead do you
have to pay for random access compared to the overall picture.  I do not
think this is a main issue in this whole discussion.


Wed, 19 May 1993 02:50:27 GMT  
 [ 1 post ] 

 Relevant Pages 

1. C++/FORTRAN for numerical work

2. Fortran vs. C for numerical work

3. Fortran vs. C for numerical work

4. Fortran vs. C for numerical work

5. C vs Fortran for numerical work

6. Fortran vs. C for numerical work

7. C vs Fortran for numerical work

8. Fortran vs. C for numerical work

9. Re : Fortran vs. C for numerical work

10. Numerical discrepancies between MS Fortran 5.1 and Fortran Powerstation

11. Setting up vc++ to work with effiel

12. .cs create polygon $xy does'nt work


Powered by phpBB® Forum Software