[Beowulf] Threaded code (& Fortran)
Robert G. Brown
rgb at phy.duke.edu
Thu Aug 19 06:48:09 PDT 2004
On Wed, 18 Aug 2004, Jeff Layton wrote:
> Never messed with geometric algebra nor clifford algebra (isn't that
> 'red' algebra
> anyway - you pinko communist!). Now I have messed quaternions before (used
British, my friend, British. Clifford was English, mostly
pre-communist. Or perhaps German if you prefer that Grassman form.
Quaternions are of course due to Hamilton, and there is a famous bridge
in Dublin where he was supposedly walking with his wife when he had the
sudden insight into how to create a four component non-commutative
division algebra that has i^2 = j^2 = k^2 = ijk = -1, which he promptly
carved into the bridge itself as rude grafitti.
> I also like that fact that Fortran arrays start with 1 and that
> something like
> A(1,2) is A(first row, second column). Just like the mathematics that we
> use. :)
Oh, you mean like the tensors used in SO(3,1), O(3), SU(2), SU(3), and
so forth? Like spherical harmonics, Y_lm with l = 0,1,... and m = -l,
-l+1, ... l-1, l? Like 3j, 6j and 9j symbols (ditto, but with a lot
more indices)?
Not an idle observation -- my largest Fortran code was in fact a code
that did angular momentum coupling computations in nuclear scattering
theory involving products/sums over some 26 3j symbols in one
formulation and a handful of 3j, 6j and 9j symbols in another
formulation (the idea being to compare the numerical results and
determine if they were the same, thus validating a few dozen pages of
algebra).
One wastes a LOT of space padding out the triangular subtensors into
a massive rectangular tensor, and then there is the total PITA
associated with having to compute the matrix displacement associated
with a given l,m. Might as well work in assembler or with raw pointers
-- it's that bad.
With C, of course, you can pack a perfect lm-indexed tensor, in any
number of dimensions, and not waste a byte. Pointers enable
computational miracles.
> As a word of caution, I've been forced to code in VB (yuck, ick) and
> different versions of VB have arrays that start with 0 or 1 depending
> upon the version you're using. This caused more problems that I like
> to think about. Yuck - double yuck - triple yuck.
I've taken a vow never to learn YAPL, so VB is safe from me. Of course
I've had to break that vow twice in the last four years anyway, so I
don't know what it is worth, but I'm really TRYING to never have to
learn another language.
> I always write my equations in columns 7 to 72 - don't you? :) Of course,
> you know that F90 has broken this rule don't you?
Sure, after enough people abandoned fortran for the work of the devil
that it is and embraced the true and pure light of C (why hide the
religious nature of this discussion:-), its dark masters began to
embrace the forms and rituals of the true faith in order to win souls
back to its satanic creed. Surely you've noticed that "fortran" is an
anagram of "rant for" (or "nor fart" or "torn rat"), which must mean
something. The latter especially. Who would use a language that has a
hidden message encouraging the torturing of ugly animals? Even animals
associated with dark rites and witchcraft...
C on the other hand, is anagram free. C is C is C. Clearly a holy
message. Such a simple shape, a graceful curve like a ballerina's
delicate form. It can even be though of as standing for "compute",
which is after all what programming languages are all about.
> Start coding in Fortran or the dog gets it! (lots of movie scense pop
> into my head
> at this point including 'Vacation' where they dragged the dog behind the
> family
> truckster).
>
> You turn. :)
Hmmm, see if this compiles and runs (it's been a while, so I'm not to
sure about the right number for stdout). There is a message there for
you;-)
DO 10 I=1,10
I = I-1
WRITE(3,100)
WRITE(3,200)
10 CONTINUE
100 FORMAT("I WILL NOT PROGRAM IN FORTRAN EVER AGAIN")
200 FORMAT("AND YOU SHOULDN'T EITHER")
rgb
--
Robert G. Brown http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567 Fax: 919-660-2525 email:rgb at phy.duke.edu
More information about the Beowulf
mailing list