Best FORTRAN compiler for Leaopard
I am running OS 10.5.2 on a MacBook Pro (Intel 2.4 GHz) with 4 GB RAM. I am about to add a Mac Pro tower 2.8 GHz with 8 GB RAM (OS 10.5.4). t has been many years since I have programmed in FORTRAN and I now have a need for a FORTRAN compiler. However, I am very confused as to which compiler version I should use.
I have than Intel FORTRAN system (10.1.008) but I find that the documentation is very confusing as to location and content.What i am looking for is a good compiler that works seamlessly with Leopard and has solid documentation (references, installation, debugging, etc.). I am also open to outside texts that are FORTRAN tutorials.
I see that there are a variety of compilers available and I need one that will handle massive compute-bound numerical calculations requiring 10^8 to 10^9 double precision floating point multiplications. The code could run to 10^5 lines of FORTRAN.(I will be trying to develop a solution to the 5 semiconductor equations for a specific semiconductor device.)
The massiveness of the undertaking is why I need a Mac Pro with large RAM capacity as the MacBook Pro is just inadequate.
I would appreciate any ideas and thoughts. Thanks much,
Tom Casselman
cassco@c-fourth.com



ifort and gfortran
I use both ifort 10.1 and gFortran when I program. Both programs have installers that will do everything needed as long as you use the default settings the installers use. Once you run these installers both compilers should work fine.
The ifort compiler does a better job of pointing out possible problems (not just errors) at compile-time. The gFortran compiler does a better job of giving meaningful error messages when it hits an error at run-time. Once the code is written and works, ifort produces code that runs faster when you set the appropriate flags. Speaking of flags, I will give you what I generally use when I compile (there are other flags you can use-but these are the ones that I have found most helpful).
For Debugging under gfortran:
gfortran -g -fbounds-check -Wuninitialized -O -ftrapv -fimplicit-none\
-fno-automatic
For optimized code under gfortran:
gfortran -O3 -ftree-vectorize
For Debugging under ifort:
ifort -m64 -g -debug all -check all -implicitnone -warn unused\
-fp-stack-check -heap-arrays -ftrapuv -check pointers\
-check bounds
For optimized code under ifort
ifort -m64 -fast
Note that the "-m64" flag is a Mac only flag, it doesn't work in Linux.
After preaching this to several of my office mates for months, one of them started using both ifort and gfortran and was amazed that they could more quickly find and fix bugs in the code if they compiled and ran using both compilers.
Keeping in mind that I'm not a programmer...
My manager, however, is one of the sharpest HPC-oriented programmers I know. While he has much more experience with Linux than MacOS X, I have heard him say more than once that the GNU Fortran compiler produces the slowest code of any Fortran compiler. YMMV...
Kevin
Best FOTRAN compiler
Honestly,
when solving 'large' partial differential equation problems, a speed up of 2 (either due to hardware or due to compiler efficiency) is not very much -- at least if your system has more than one dimension. Just coarsen your discretisation a little, and you'll be just as quick...
Ifort is nice and fast, but new versions of gfortran are not bad either. For a few years, gfortran did not support vector-extensions (altivec, SSE1-SSE4), so it's code could be a few times slower than ifort code. Now gfortran does support these, so it's just a little slower (for my stuff approximately 30%). In the end, I use ifort for large production runs on clusters, gfortran (with MPI) on my macbook for development.
Works very well!
Andreas
Auto-parallelization
At the moment, ifort can do auto parallelization (where you don't need to use OpenMP), whereas gfortran can't, although as said above both can now do vectorization. Whether this is going to help or not depends on whether each loop iteration is independent or not.
The switch to use is -parallel and you might need to turn on 'runtime parallel check' depending on your loop's characteristics.
Does anyone know if it's possible to switch gfortran and intel fortran in XCode - I don't have any drop down menu item in the build options for gfortran even though it's installed on my mac.