[Beowulf] Stroustrup regarding multicore
kspaans at student.math.uwaterloo.ca
Tue Aug 26 13:33:34 EDT 2008
(DISCLAIMER: I'm still very much a novice programmer, and I can count the 10's of lines of C code
that I've written on my two hands.)
I've been trying to understand this very debate for a couple of months now, ever since some, uhh,
"experienced" (:P) aquaintaces of mine discussed the advantages of Fortran over C for work with
multidimensional data. At first I didn't understand it at all. Something about array indexing
I've been using Fortran 90 (_always_ IMPLICIT NONE, sane variable names, modules, never written a
GOTO statement in my life, etc) for about 8 months now on my co-op work term. I can see how easy it
is to create and dynamically allocate arrays of any dimension. I'm not too sure how it's working
under the hood just yet, but I've heard that Fortran arrays carry around a little bit of extra
metadata about the size of the array?
Either way, I've recently started writing Conway's Game of Life in C, as an exercise. I needed to
figure out how to dynamically allocate a 2D array. I found an answer on the comp.lang.c FAQ.
It's not terribly complex, but it seems to me like it's more involved than with Fortran.
And if it came to an array of dimension >> 3, wouldn't that be a lot of array indicies and deferences
to calculate as the dimensions added up. That's assuming you go with option 1 from the FAQ. Option
2 looks more reasonable to me. But couldn't this explain at least part of Fortran's "advantage"?
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
More information about the Beowulf