Earlier quoted context omitted.
> Now you need to do a follow on study to see how much science the 'rival' group does with a more modern codebase than your 'legacy' group does. I would guess that a C++ codebase written by PhD students, not by seasoned C++ experts, is more complicated and much slower to debug, than a corresponding Fortran codebase.
Well, that Fortran codebase probably also was written in large parts by PhD students, not export Fortran programmers.
Why physicists still use Fortran (2015)
101–110 of 300 posts
Re: Why physicists still use Fortran (2015)
#102Earlier quoted context omitted.
>Unless you're passing arrays of pointers That seems to be the context from his example: for(i = 0; i I suppose the counterpoint is that he's doing it wrong. But again, maybe physicists just don't want a tool with that much flexibility.
Fair enough then, I suppose that in C you have to do something like that if you want both that your matrix size is decidable at runtime, and to be able to index it with m[x][y] rather than some function.
Re: Why physicists still use Fortran (2015)
#103One of the key points of the article is that there is a lot of legacy code written in Fortran. As a former high energy physicist, I have an anecdote here that some people might find interesting. There was a library written in Fortran called CERNLIB which included a broad variety of miscellaneous numerical algorithm implementations ( e.g. minimization, integration, special functions, random number generation) [1]. I c…
Re: Why physicists still use Fortran (2015)
#104Earlier quoted context omitted.
Yes, the electronic structure community is rapidly moving away from Fortran. In my opinion, Fortran will fall behind as newer hardware, libraries, etc, will drop Fortran support. Also, newer grad students are all much more interested in C/C++/Python. I think this is in part because the newer languages are widely used outside of science and therefore there is much more documentation and tutorials/guides. Not to mentio…
> Yes, the electronic structure community is rapidly moving away from Fortran. Really? Seems to me that with very few exceptions (e.g. GPAW which is python/C and nwchemEx which I've never heard about until the parent poster mentioned it), electronic structure is pretty much a Fortran bastion. (Source: I did a Phd doing mostly electronic structure calculations, graduated ~5 years ago)
New libraries are being written in C/C++, and maybe Python. This includes libraries that should form the foundation of the QM community (matrix/tensor and integral libraries). These are meant to take advantage of newer hardware and libraries which themselves are written in C/C++, and often in a way that is inaccessible from Fortran.
The old Fortran code will be around for a long time, but I don't know of any large-scale, serious efforts to develop new packages or major new functionality that are starting with Fortran.
(I'm not totally against Fortran - I just spend a week devloping in it. But I still much prefer C++ and Python)
Re: Why physicists still use Fortran (2015)
#105Earlier quoted context omitted.
I may be mistaken but I believe the Intel Fortran compiler supports the MS Fortran extensions
Interesting -- I'll look into it. Is it open-source (in the spirit of future-proofing)? Answering my own question: It doesn't appear to be.
Re: Why physicists still use Fortran (2015)
#106Be careful about performance comparisons: If 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)
#107Earlier quoted context omitted.
TensorFlow is for machine learning, not general purpose computations. And no, you will not get better results from a neural network than state of the art computational fluid dynamics. As for general purpose GPU programming, some parts physics are GPU friendly put not all of them.
IIRC there was some project doing more or less real-time weather forecasts for small areas (think airports and such) that used deep learning instead of traditional CFD style simulations. They were able to do it with several orders of magnitude less CPU usage than the CFD calculations.
Re: Why physicists still use Fortran (2015)
#108Earlier quoted context omitted.
Yep. Most of my programming classes were either in pascal or c when I was in undergrad, but in my physics courses, all the way through my graduate education, I used FORTRAN. It's because physics doesn't change that much over the years, FORTRAN code that is time-tested and that works exists and there's no need to re-invent the wheel in another language when more interesting and important problems exist to solve.
David Baker's Rosetta code, which made him a pile of money, is IMO a spectacular example of craptastic C++ written by people who really didn't understand C++ but didn't let that deter them from using every single feature of the language, badly. Some years back we tried to port it to CUDA but there were so many levels of indirection, dereferencing, and virtual functions that it was nearly impossible to make any progre…
Re: Why physicists still use Fortran (2015)
#109"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…
Curious if anyone in your group considered using it?
Re: Why physicists still use Fortran (2015)
#110Earlier quoted context omitted.
I don't know. Having "rewrote X kloc of scientific Fortran to modern idiomatic C++" on your CV should get you to the head of the line in many places when looking for a job.
Only if you go after run of the mill coding jobs after your phd, in which case why bother at all. When applying for a postdoc, you'll very much want to bury that part of your work.