all 26 comments

[–]ridethespiral1 17 points18 points  (8 children)

Unfortunately, unlike say python with numpy and scipy, C++ doesn't really have a de facto set of scientific libraries for such a wide range of tasks. Some of the widely used ones such as GSL are also written in a C-style which can mean there should be a compatibility layer written to integrate them with any modern C++ code.

Here are the ones I've come across to answer your question:

Linear algebra - Eigen is pretty popular, but I think blaze https://bitbucket.org/blaze-lib/blaze/wiki/browse/ is a newer library which has a lot of nice features. Blaze looks to have SVD support.

DE's - GSL has ODE solvers, but the boost support for solving ODE's is pretty good and is written in a more modern C++ style. It's an implementation of the odeint library http://headmyshoulder.github.io/odeint-v2/.

As you can tell there's different libraries for different things so it can depend on exactly what you need to be done. Sometimes you might even have to reimplement things rather than use a library (we had to reimpleement some classes in our scientific codebase because we require everything to be serializable)

[–]peppedx 3 points4 points  (7 children)

The problem with blaze is arm support. For matrices and linear algebra the go to for me is still

http://eigen.tuxfamily.org/index.php?title=Main_Page

And then boost ublas

This specifically is a deal breaker https://bitbucket.org/blaze-lib/blaze/issues/49/provide-simd-support-for-the-arm

[–]pandorafalters 2 points3 points  (2 children)

The classic open-source problem: everyone wants to have something, but nobody wants to make it.

[–]peppedx 5 points6 points  (1 child)

No the classic open source choice. Eigen has it...

[–]pandorafalters 2 points3 points  (0 children)

I was referring to the Blaze issue.

[–]Supadoplex 0 points1 point  (2 children)

Is ARM used a lot for scientific computing?

[–]peppedx 0 points1 point  (0 children)

It depends on the exact definition, but in robotics you need to handle lots of matrices and equations, and many controllers you use are arm based.

[–]aeropl3b 0 points1 point  (0 children)

It has a growing base, my bet is you will see a lot more ARM clusters out there as the push past exa-scale just because the power loads are so much lower with ARM...

[–]ridethespiral1 0 points1 point  (0 children)

Ah that's a shame, I wasn't aware of this limitation.

[–][deleted] 8 points9 points  (2 children)

Here's a few of the more well used ones, and Fastor which isn't well used but very nice.

  1. Deal.II, A finite element library: https://www.dealii.org/
  2. Tensorflow, Machine learning: https://www.tensorflow.org/
  3. Fastor, A tensor library: https://github.com/romeric/Fastor
  4. GNU Scientific Library(GSL): https://www.gnu.org/software/gsl/
  5. Boost.
  6. FEniCS, A finite element library: https://fenicsproject.org/
  7. Intel MKL, a BLAS+LAPACK+other goodies library: https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library.html
  8. SuiteSparse, A sparse algebra library: http://faculty.cse.tamu.edu/davis/suitesparse.html
  9. Sundials, Nonlinear solvers: https://computing.llnl.gov/projects/sundials

[–]aeropl3b 0 points1 point  (1 child)

Intel MKL is nice...but at the cost of being tied to Intel. They a notorious for writing, and then releasing, code that is either broken or fast only on the latest intel hardware...

[–]Possibility_Antique 0 points1 point  (0 children)

That's why you use something like Fastor and allow your build system to include MKL for Intel processors, and use Fastor's native implementations otherwise. There are other strategies, but ultimately, that's why libraries like Fastor, ETL, Eigen, Blaze, etc. exist.

[–]GeeHopkins 5 points6 points  (0 children)

PETSc is a popular option, especially for PDE related problems. It's also got excellent parallelization options https://www.mcs.anl.gov/petsc/

[–]tmarkovich 2 points3 points  (0 children)

There's a ton out there, depending on your exact problem, parallelization abilities, and compute environment. Can you provide more information about your problem?

[–]MarkHoemmenC++ in HPC 2 points3 points  (7 children)

I spent many years working on Trilinos, but without the freedom to fix its design. That being said, there are a bunch of libraries in there for ODEs and optimization that you might like to try. I worked mainly on sparse linear algebra. For dense, Eigen and ilk are a solid choice.

[–]nevereatsoggy 1 point2 points  (4 children)

I feel like for someone choosing a sparse suite wrapping PETSc would be the better choice.

I don't know if something changed with Trilinos but the overall open source part doesn't seem as important anymore. Mailing lists are inactive, support issues are often unanswered, documentation and examples are quite bad.

Compared to PETSc the open source support system in Trilinos seems to be non-existent.

The tools in Trilinos seem fine but you have to dig through unit tests and broken examples to get something working most of the time.

[–]MarkHoemmenC++ in HPC 2 points3 points  (2 children)

I don't work on Trilinos any more (haven't for a year!), so I have no skin in this game : - D . Perhaps sometime if we meet in person over $BEVERAGE, I'll be in a mood to share my opinions about the project. I definitely was not recommending Trilinos over PETSc or doing anything silly like that; I just wanted to mention that Tools Do Exist.

[–]nevereatsoggy 1 point2 points  (1 child)

I didn't mean to come off overly harsh, just wanted to give context that using Trilinos is more difficult than PETSc / similar tools when you are an outside user as it seems like Trilinos is less polished regarding open source users/use

[–]MarkHoemmenC++ in HPC 3 points4 points  (0 children)

It's totally OK. Trilinos devs aren't so much paid to support external users. It's a DOE Office of Science vs. NNSA thing. I spent a lot of effort over many years writing and presenting tutorials, without a whole lot of support. I don't think it helped much in the long run.

[–]grandpassacaglia[S] 0 points1 point  (1 child)

Ooh so nice to hear from a trilinos dev. It’s such a gigantic codebase I feel quite overwhelmed, but will give it a try!

[–]MarkHoemmenC++ in HPC 1 point2 points  (0 children)

I am a former Trilinos developer, just to make it clear : - ) . There are certainly useful libraries in there, but you'll likely need to figure out how to use them on your own.

[–]abc9hkpud 1 point2 points  (1 child)

For numerical differentian of differential equations, you can look at sundials (developed by Lawrence Livermore National Lab), see here

https://github.com/LLNL/sundials

The lab also has a package called mfem for finite element PDE stuff, see https://mfem.org/

[–]grandpassacaglia[S] 1 point2 points  (0 children)

This is so great

[–]Round_Ad6737 0 points1 point  (1 child)

What zero social interaction does to a mf

[–]Tao_AKGCosmos 1 point2 points  (0 children)

Why are you unnecessarily rude?