Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Programming

A C++ Library That Brings Legacy Fortran Codes To Supercomputers 157

Posted by timothy
from the fort-went-that-way dept.
gentryx writes "In scientific computing a huge pile of code is still written in Fortran. One reason for this is that codes often evolve over the course of decades and rewriting them from scratch is both risky and costly. While OpenMP and OpenACC are readily available for Fortran, only few tools support authors in porting their codes to MPI clusters, let alone supercomputers. A recent blog post details how LibGeoDecomp (Library for Geometric Decompostition codes), albeit written in C++, can be used to port such codes to state-of-the-art HPC systems. Source code modification is required, but mostly limited to restructuring into a new pattern of subroutines."
This discussion has been archived. No new comments can be posted.

A C++ Library That Brings Legacy Fortran Codes To Supercomputers

Comments Filter:
  • by Mitchell314 (1576581) on Saturday September 21, 2013 @11:50AM (#44912197)
    In old codes, you're already familiar with the existing quirks and bugs, and the base is heavily patched up from years of debugging.
  • by Anonymous Coward on Saturday September 21, 2013 @11:55AM (#44912239)

    Fortran is by no means outdated. Seriously, check out the new Fortran 2008 standard and its state-of-the-art compilers (e.g. the NAG one).
    You'll be blown away by its speed and clean looking code. C++ might have features that fortran lacks (complex template usage seems rather popular), but that doesn't always reduce the development time. At least that my experience.
    As long as you're working on scientific projects, fortran is practically unmatched.

  • Re:Code... (Score:3, Insightful)

    by John Burton (2974729) on Saturday September 21, 2013 @12:05PM (#44912301)
    I couldn't agree more. Although the word "codes" is usually a red flag not to bother reading any more in any article or question
  • by mjwalshe (1680392) on Saturday September 21, 2013 @12:21PM (#44912403)
    have you any idea how much it woudl cost to port it to cludgy C++ (which lacks a lot of things needed for scientific computing) you then have to re-qualify All of your models which is both time and resource intensive.
  • Re:Code... (Score:4, Insightful)

    by boristhespider (1678416) on Saturday September 21, 2013 @02:03PM (#44912891)

    Oh now, that's a bit harsh. Programming in Fortran isn't something done because people are afraid of work. I genuinely get tired of the incessant Fortran-bashing by people who -- in my experience, at least -- have almost never, if ever, actually used the language or seen why other people do. In most cases they seem to be repeating jokes their lecturers made about the language, jokes that were first written back when FORTRAN 77, with those stupid capitals and all, was the dominant form.

    Now, I'm very much not a fan of F77. In fact, I hate the language. It's clunky and decrepit and not suited for modern programming practices. But it's easy to call from later Fortran standards, and each one has vastly improved the situation. Fortran 2008 is a genuinely nice language. True, it's not OO - though you can force it to act almost as if it is - but not everything has to be forced into OO. What it is is extremely good for numerical work, and dealing with arrays in particular in Fortran is a dream after, say, C, or even C++11. The fact it calls F77 routines without effort or pain also helps, since there genuinely is a vast body of code still in F77. (The oldest I came across was F66, ported directly from Fortran IV. Now that really did need to be rebuilt in something approaching a sane language.)

    I'm not saying F2008 is "better" than either C or C++11 -- that's a meaningless statement. But there are things that make it a very nice language to use, and other things -- character strings, I'm looking at you -- that make it distinctly unpleasant. Same as any other language, really.

  • by msobkow (48369) on Saturday September 21, 2013 @02:26PM (#44912991) Homepage Journal

    You don't have to rewrite your code entirely, just a little bit.

    You only have to restructure the subroutines and change the syntax.

    Well, that sounds like rewriting to me. Just because there is a library that might implement the same semantics as FORTRAN's math does not mean that it isn't a rewrite, coming with all the risks for new errors and gotchas that that implies.

EARTH smog | bricks AIR -- mud -- FIRE soda water | tequila WATER

Working...