Seeing the author talk about "C/C++" like it's one language (and basically just C) is frustrating.
Why physicists still use Fortran (2015)
31–40 of 300 posts
Re: Why physicists still use Fortran (2015)
#32Earlier quoted context omitted.
FORTRAN is still in much of the R Core. Fortran is faster than C++ and I actually feel that many people are starting to realize why we still have FORTRAN around. Though there are many using Python + Numpy R still have a larger piece of user base in scientific and mathematical spaces.
"Fortran is faster than C++" Whats your usecase? It seems it is faster for some, but a lot slower in others: https://benchmarksgame.alioth.debian.org/u64q/compare.php?la...
Re: Why physicists still use Fortran (2015)
#33"Professors usually have this legacy code on hand (often code they wrote themselves decades ago) and pass this code on to their students. This saves their students time, and also takes uncertainty out of the debugging process." This is so true. I'm a PhD student in physics using Fortran for pretty much that reason. At the start of my PhD, in response to my supervisor telling me I should learn Fortran to modify our cu…
Graduate students need to think in terms of 4-6 years while forward looking professors might want to think in terms of 5-15 years.
Re: Why physicists still use Fortran (2015)
#34If you are using the GNU compilers (and the appropriate compiler flags with gcc), there isn't much difference in performance --- and there shouldn't be.
There are a few FORTRAN-only compilers out there; I'd be curious to see how well they do.
Re: Why physicists still use Fortran (2015)
#35A slight gap in knowledge in the piece: Most Python libraries for numerical computation are written in C/C++ or... Fortran. Last time I had to compile scipy from scratch I had to install gfortran.
Some of the Numpy code is coming from 1970s: it uses BLAS that originates from 1979. https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprogra... Immense amount of effort was put in performance, correctness, feature set, and numerical stability of such widely used libraries. Replacing the without a very good reason is hardly feasible.
Basically I refused to touch this thing, using a library which makes the code unreadable is going to be a bug magnet. I would be surprised if I was the only one having this reaction to 1960s coding convention surfacing in modern code.
So selling new licenses should be a good enough reason.
Re: Why physicists still use Fortran (2015)
#36"Professors usually have this legacy code on hand (often code they wrote themselves decades ago) and pass this code on to their students. This saves their students time, and also takes uncertainty out of the debugging process." This is so true. I'm a PhD student in physics using Fortran for pretty much that reason. At the start of my PhD, in response to my supervisor telling me I should learn Fortran to modify our cu…
Potentially your "rival groups" will have a long term advantage now though. This might be bad for the graduate students that did the work, but could be good for the professor and group over the next decade. Graduate students need to think in terms of 4-6 years while forward looking professors might want to think in terms of 5-15 years.
Re: Why physicists still use Fortran (2015)
#37My understanding is that the code modernization and co-design efforts that are a part of the Exascale initiative are changing this.
Re: Why physicists still use Fortran (2015)
#38> The benchmarks where Fortran is much slower than C/C++ involve processes where most of the time is spent reading and writing data, for which Fortran is known to be slow. Why would IO be slow in any language? What does the language have to do besides buffering and system calls? > In Fortran, variables are usually passed by reference, not by value. Under the hood the Fortran compiler automatically optimizes the passi…
I believe many Fortran implementations default to unbuffered io.
Which is probably easy enough to change.
But I think that's really the core issue. Physicists don't want to learn more about programming languages. They want whatever mostly works out of the box and has local documentation and expertise specific to their problem domain.
>Aren't arrays implicitly passed by reference in C also?
He covers that. C passes arrays by reference, but the individual elements aren't contiguous. He says Fortran passes an optimized reference.
Re: Why physicists still use Fortran (2015)
#39"Professors usually have this legacy code on hand (often code they wrote themselves decades ago) and pass this code on to their students. This saves their students time, and also takes uncertainty out of the debugging process." This is so true. I'm a PhD student in physics using Fortran for pretty much that reason. At the start of my PhD, in response to my supervisor telling me I should learn Fortran to modify our cu…
as someone who had contact with that codebase, do you have any insights as to why that is?
Was it the sheer size of the thing? Was it some nuance that Fortran had as an advantage over other languages? was the math just difficult to follow?
Genuine curiousity.
Re: Why physicists still use Fortran (2015)
#40"Professors usually have this legacy code on hand (often code they wrote themselves decades ago) and pass this code on to their students. This saves their students time, and also takes uncertainty out of the debugging process." This is so true. I'm a PhD student in physics using Fortran for pretty much that reason. At the start of my PhD, in response to my supervisor telling me I should learn Fortran to modify our cu…
Potentially your "rival groups" will have a long term advantage now though. This might be bad for the graduate students that did the work, but could be good for the professor and group over the next decade. Graduate students need to think in terms of 4-6 years while forward looking professors might want to think in terms of 5-15 years.
However, I guess one drawback is that a lot of the things we currently implement are all written from scratch (for very standard things such as numerical differentiation and parameter optimisation), which has the advantage of having "control" and more understanfing over the code, but less time saving/potentially not as efficient as using pre-existing libraries.