5 ms·
The main reason Fortran is so extensively used today is not because of the merits of its new features but the incredible amount of (intrinsically complicated, b
by yiyus 12y ago
The main reason Fortran is so extensively used today is not because of the merits of its new features but the incredible amount of (intrinsically complicated, but even more because it is highly optimized) legacy code. I guess that most of that 50% running in HPC is FORTRAN77 written many, many years ago, with a bit of Fortran90/95 and only an insignificant fraction of Fortran 20xx.
- drjesusphd 12y agoNo, Fortran is just plain fast. It's not just institutional inertia. Luckily there are things like Julia now that may eventually change the landscape.
- IndianAstronaut 12y agoCan Julia compete with Fortran and C? I still thought Julia still uses BLAS.
- KenoFischer 12y agoSo do Fortran and C. BLAS is written in assembly.
- drjesusphd 12y ago> I guess that most of that 50% running in HPC is FORTRAN77 written many, many years ago Is this blind speculation?
- yiyus 12y agoIt's a guess based on my limited experience.
- cbd1984 12y agoAssuming the FORTRAN77 was optimized for hardware circa a period when FORTRAN77 wasn't considered an ancient language, is it still optimized on modern hardware? Because it seems the vast increase in the relative importance of cache alone, not to mention the great changes in cache sizes, would make some optimizations fairly pessimal these days. (For example, loop unrolling blowing out I-cache.)
- colechristensen 12y agoLanguages aren't optimized, compilers are, and fortran compilers commercial and free are released regularly.
- cbd1984 12y ago> Languages aren't optimized, compilers are Actually, specific pieces of code get optimized, and compilers that can "undo" optimizations put in to the source code by hand are so rare I daresay they don't exist.
- brorfred 12y agoThe intel compiler is considered to generate runtimes that runs about twice as fast as runtimes from gfortran. Haven't seen any recent tests of CLANG/LLVM yet. The statement that compilers, not languages, are optimized generally holds true for Fortran.
- gnufx 12y ago"Considered" maybe, but not measured in practice. Of course you need equivalent optimizations to generate similar code -- Intel even defaults to incorrect optimizations. GCC is also substantially more reliable in my experience watching users who insist on using Intel on HPC systems without actually measuring anything. Of course compilers are relevant, but Fortran has long presented optimization possibilities that aren't typically available in other languages, like not passing by reference.
- colechristensen 12y agoIt's also that for many HPC science things; the programming effort isn't anywhere near the main effort. The science behind the code takes years and the code execution can take hours, days, or months. The people writing the code are scientists, not programmers, and aren't all that interested in the languages they use being 'nice'.
- brorfred 12y agoThis is my experience. It is so much easier to get a Post Doc up to speed in Fortran, than pretty much any other language. The best case scenario is that professional programmers write the frameworks and infrastructure, and that non-programers produce subroutines and other functional parts of the code. The worst case scenario is when the entire code base is produced by non-programmers...
- rootbear 12y agoAt NASA Goddard, they run climate models on our supercomputer and they are mostly in Fortran. I asked one of the developers once and he said the bulk of it was in Fortran 90/95. But there is still a lot of Fortran 77 code around, particularly in well-debugged libraries. This developer wanted to use a more modern dialect and take advantage of some of the new features, like object orientation, but it was hard to get the scientists to learn the new features. That's a big part of why Fortran endures, it's simple inertia. During development of the original ANSI standard for C, the Cray rep and others wanted to add features that would enable C to kill Fortran. This meant adding complex numbers (which happened in C99 and was made optional in C11), and doing something about unrestricted pointers. The latter lead to the noalias fiasco, but ultimately we got strict, which accomplishes the same goal.