News for hackers. Stuff that matters.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by taeric on Thursday May 18, 2023 @11:03AM (#35988976)
Amusingly, "well-optimized C code" includes calling out to fortran libraries. :D

https://numpy.org/doc/1.13/user/building.html

Re:SciPy: Interested in adopting PRIMA, but little appetite ... by cfcf14 on Thursday May 18, 2023 @11:06AM (#35989013)
It's turtles all the way down, except for the final turtle, which is Fortran...
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by bee_rider on Thursday May 18, 2023 @12:22PM (#35990286)
The last turtle is probably assembly, or at least intrinsics, in most good BLAS implementations. Probably called from C, because that’s easier in C.

The nice thing about Fortran is that you get something almost as good, but a normal engineer can write it. There are more C programmers than Fortran programmers, but there are more Fortran programmers than there are C programmers who can write really good assembly kernels. And all the C programmers in that last group are already working on vendor BLAS implementations.

Re:SciPy: Interested in adopting PRIMA, but little appetite ... by whimsicalism on Thursday May 18, 2023 @11:24AM (#35989300)
That's a 6 year old documentation page, modern numpy does not use fortran in any way except that maybe you have a particular BLAS reference implementation.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by adastra22 on Thursday May 18, 2023 @11:40AM (#35989576)
Numpy is basically a wrapper to BLAS and LAPACK though, so it seems a bit odd to ignore the fact that those system libraries are usually written in Fortran.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by whimsicalism on Thursday May 18, 2023 @11:54AM (#35989794)
The reference implementation is written in Fortran, but I'm not sure about the implementations actually used. OpenBLAS has fortran components, but I believe cuBLAS and MKL are vast majority C/C++.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by taeric on Thursday May 18, 2023 @12:15PM (#35990190)
This is a very fair challenge. My understanding was that the main ones in use were fortran and it is very interesting to see that may not be the case. Love to see any benchmark or other comparisons on the options, if you know of any good links.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by adastra22 on Thursday May 18, 2023 @01:45PM (#35991538)
cuBLAS is not Fortran because it targets NVIDIA GPUs. Despite what the grandparent says, MKL does include some Fortran in its codebase. Most other vendor-provided BLAS and LAPACK libraries are based on the reference Fortran implementation. Even OpenBLAS, the open-source reimplementation, has large parts written in Fortran.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by taeric on Thursday May 18, 2023 @11:45AM (#35989651)
I did link to the old one.... but if you follow the link to the new, it still has that section? I'm confused.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by whimsicalism on Thursday May 18, 2023 @11:55AM (#35989814)
The old one says you need a fortran compiler to build numpy, the other one explicitly says you don't need a fortran compiler to build numpy.
Re:SciPy: Interested in adopting PRIMA, but little appetite ... by taeric on Thursday May 18, 2023 @12:03PM (#35989963)
The new one says it auto selects. I don't think they got rid of using the fortran if it is there. They just automated a lot of that in the build.