Announcement

Collapse
No announcement yet.

FLANG: NVIDIA Brings Fortran To LLVM

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    About time. Was wondering when LLVM would have a Fortran frontend.

    Almost all the gold standard mathematical algorithms are written in FORTRAN. Prolific examples include BLAS and LAPACK which are both heavily used in industry (e.g. both of them power MATLAB). Of course, there's a re-implementations of these functions in other languages, but the ones on netlib are the gold standard.

    Reference:

    Comment


    • #12
      I did my entire PhD and MS simulation work with Fortran (2003). All codes written from scratch and made very little sense to use something like C/C++:
      1) arrays in Fortran start with index 1 -> C/C++ indexing of arrays does not lend itself well for matrix algebra (non-intuituve, intrusive, and goes against common mathematical conventions).
      2) passing arrays to functions is straightforward in Fortran. With most general-purpose programming languages one has to think too much about passing by value vs passing by reference, pointers, etc etc etc. Please let me do my math already! You spend more time "developing code" than doing physics.
      3) Fortran already has a good set of OOP features.
      4) Writing fast codes in Fortran is easy(er). Can you develop a GUI with it? Probably not. But for performing calculations, Fortran is still king.
      Last edited by toguro123; 18 May 2017, 02:32 PM.

      Comment


      • #13
        There is a comparison of Rust, Go and C against Fortran perf argument on astrophysics:

        Comment


        • #14
          Originally posted by andrei_me View Post
          There is a comparison of Rust, Go and C against Fortran perf argument on astrophysics:

          https://arxiv.org/pdf/1702.02951.pdf
          Reporting the conclusions as a tl:dr for others:


          We have shown the reliability of Rust as a programming language as opposed to For-
          tran, C or even Go. Rust allows the user to avoid common mistakes such as the access to
          invalid memory regions and race conditions. We have also shown that it is a competitive
          language in terms of speed and accuracy.
          The main challenge we experienced was the initial learning curve, it was necessary
          to really understand and get used to the ownership and borrowing concepts. Once the
          paradigm shift is done, the benefits are immediate. We therefore encourage the commu-
          nity to consider Rust as a language that will help us produce good quality, memory safe,
          concurrent and high-performance scientific code.



          I approve the findings of this article.

          Comment


          • #15
            Originally posted by toguro123 View Post
            I did my entire PhD and MS simulation work with Fortran (2003). All codes written from scratch and made very little sense to use something like C/C++:
            1) arrays in Fortran start with index 1 -> C/C++ indexing of arrays does not lend itself well for matrix algebra (non-intuituve, intrusive, and goes against common mathematical conventions).
            2) passing arrays to functions is straightforward in Fortran. With most general-purpose programming languages one has to think too much about passing by value vs passing by reference, pointers, etc etc etc. Please let me do my math already! You spend more time "developing code" than doing physics.
            3) Fortran already has a good set of OOP features.
            4) Writing fast codes in Fortran is easy(er). Can you develop a GUI with it? Probably not. But for performing calculations, Fortran is still king.
            Given what you state here, I think that it isn't that hard to write a C/C++ library of wrapper/helper functions that let people write decent math-oriented code. Did you try any opensource scientific C libraries? There are a bunch in the wild.

            Comment


            • #16
              Originally posted by starshipeleven View Post
              Given what you state here, I think that it isn't that hard to write a C/C++ library of wrapper/helper functions that let people write decent math-oriented code. Did you try any opensource scientific C libraries? There are a bunch in the wild.
              Maybe. Or you could just use Fortran and be done with it.

              I did use Armadillo. It worked OK.

              The only programming language I see can replace Fortran for numerical calculations is Julia.

              Comment


              • #17
                Originally posted by toguro123 View Post
                Maybe. Or you could just use Fortran and be done with it.
                I just pointed out that the reasons you posted aren't exactly hard to work around.

                You made it sound like it was some technical limitation of C, when the issues you stated are actually a consequence of the fact that Fortran is still perfectly fine since math isn't changing much, so none bothered making something better for C/C++ (or you/others doing that stuff didn't bother searching for such libraries as you had already a good tool for the job, which is still basically the same).

                Comment


                • #18
                  Originally posted by starshipeleven View Post
                  I just pointed out that the reasons you posted aren't exactly hard to work around.

                  You made it sound like it was some technical limitation of C, when the issues you stated are actually a consequence of the fact that Fortran is still perfectly fine since math isn't changing much, so none bothered making something better for C/C++ (or you/others doing that stuff didn't bother searching for such libraries as you had already a good tool for the job, which is still basically the same).
                  Well to clarify then. C/C++ is fully able to get the job done.. At the cost of more tinkering, even if you use something like Armadillo. Fortran comes ready, C/C++ needs supplements.

                  Anyway, it does not matter. We are going in circles here.

                  Comment


                  • #19
                    I think Nvidia are trying to win the $55,000 prize in the NASA Fun3D challenge:

                    https://www.nasa.gov/aero/nasa-issue...rcomputer-code

                    Comment


                    • #20
                      Originally posted by toguro123 View Post
                      Fortran comes ready, C/C++ needs supplements.
                      Yeah, that's because Fortran is specific for calculations while C/C++ is multipurpose. With multipurpose languages you need to add libraries or write a ton of plumbing code by yourself if you want to do anything remotely complex.

                      Comment

                      Working...
                      X