Mac Science Collaboration group

Michael Crawford mdcrawford at gmail.com
Mon May 11 15:35:28 PDT 2009


Apple has some scienific computing software, that is specially
optimized for the Mac OS and the processors it uses.  Here's one:

   https://www.apple.com/science/profiles/osxporting/index2.html

Try a google search for:

   mac os x high performance computing

and you'll find lots of interesting stuff.

While discussing a product idea with a friend of mine, I mentioned
that Bjarne Stroustrup was dismayed that C cannot guarantee that
arrays don't overlap - when a function receives an array as a function
argument, it's just a pointer, and there is no way of knowing whether
it points to the beginning of an array, just past the end or somewhere
in the middle.

While one can supply a length to iterate over, it's quite possible -
and common - that the whole array is larger than the given length.

But FORTRAN *does* have that guarantee, and so FORTRAN compilers can
optimize array operations in ways that C compilers - and, by extension
- C++ compilers cannot.

In The Design and Evolution of C++, Stroustrup laments that in some
cases, FORTRAN optimizers can speed up array ops by a factor of
THIRTY.  I don't think I can recall a C or C++ optimizer ever getting
so much as a factor of two improvement from unoptimized code.

So when I said all that, my friend suggested that we ought to write
our product in FORTRAN!  It would be a very numerically intensive
application, with lots of big arrays.

Now, for ease of coding and maintenance, I would prefer to write in
C++ - but FORTRAN was my first language, and I've written lots of it.
So I could see how we could write all the numerically intensive stuff
in FORTRAN.

Mike
-- 
Michael David Crawford
mdcrawford at gmail dot com

   GoingWare's Bag of Programming Tricks
      http://www.goingware.com/tips/


More information about the macports-dev mailing list