7 votes
Accepted

Compiled c++ code runs much faster with double than float. Explanation?

I have looked at your simple code example, and my suspicion is that what you observe in loss of speed is due to the C-heritage requirement that right-hand side expressions be evaluated using ...
hardmath's user avatar
  • 3,349
7 votes

fastest linear system solve for small square matrices (10x10)

Using an Eigen matrix type where the number of rows and columns is encoded into the type at compile time gives you an edge over LAPACK, where the matrix size is known only at runtime. This extra ...
Daniel Shapero's user avatar
6 votes

Which Linux OS for computer science and numerical analysis

There are lots of available Linux distributions and several widely used window managers, and most of them would be perfectly adequate for your needs. It is important to make sure that the ...
Brian Borchers's user avatar
6 votes
Accepted

The difference between mkl_intel_lp64 vs mkl_gf_lp64 in a numerical reproducibility issue with Intel MKL

The various Fortran standards allow a lot of compiler dependent behaviour in terms of function binary interfaces when being called with "complicated" data types such as Fortran90 style arrays and ...
origimbo's user avatar
  • 2,229
5 votes

HPC : should I compile on the head node or on a compute node?

Let me supply a belated answer from the POV of a cluster user and a cluster administrator. A well-designed cluster will, in general, be as homogeneous as possible, with login-nodes being generally a ...
Nox's user avatar
  • 341
5 votes

Fast evaluation functions given by straight-line programs

OK, you have a very nice problem, I tried to run some benchmarks. First, I don't have your parameters so I used your small example. Second, since you do not specify the language, I used C + GSL (...
Bracula's user avatar
  • 201
4 votes

Compiled c++ code runs much faster with double than float. Explanation?

There are multiple possible explanations: with floats and doubles the different number of computations happen due to, say, ...
Anton Menshov's user avatar
  • 8,592
4 votes

fastest linear system solve for small square matrices (10x10)

Another idea could be to use a generative approach (a program writing a program). Author a (meta)program that spits out the sequence of C/C++ instructions to perform unpivoted** LU on a 10x10 system.. ...
rchilton1980's user avatar
  • 4,794
3 votes

Fast evaluation functions given by straight-line programs

Once you're at the level of a long list of expressions, there is little you can still do other than hope that the compiler finds opportunities for optimization at the assembly level. This may bring ...
Wolfgang Bangerth's user avatar
2 votes

Branch avoidance for performance with modern compilers?

To add to Wolfgang's answer, there are many expressions which look like they could be optimized by a Sufficiently Smart Compiler, but for which a general use of this optimization would be unsafe. As ...
Daniel Shapero's user avatar
2 votes
Accepted

Branch avoidance for performance with modern compilers?

Yes, modern compilers use branch avoidance if possible. For example, they would pull common subexpressions in the assignments to the variable a out of the if/else ...
Wolfgang Bangerth's user avatar
2 votes

fastest linear system solve for small square matrices (10x10)

Your question leads to two different considerations. First, you need to pick the right algorithm. Hence, the question if the matrices have any structure, should be considered. E.g., when the matrices ...
H. Rittich's user avatar
2 votes

Which Linux OS for computer science and numerical analysis

I use Debian and OpenSuse Tumbleweed on our Linux desktops. Tubleweed is a rolling distribution, so there is no concept of OS version. You get very latest softwares but could be bit unstable. If your ...
cfdlab's user avatar
  • 2,993
1 vote

Identical .so shared libraries (with no symbols) are generated when compiling different C source files

I don't think this is an appropriate question for this site, but I'll try to give an answer. Did your sysadmin or you update the OS and/or C++ compiler/library under the hood since the last time you ...
Bill Barth's user avatar
  • 10.9k
1 vote

Fast evaluation functions given by straight-line programs

Would it be possible to do the 1 billion runs method-parallel? Even if there is no way to parallelize the interior of the method body, depending on your problem, you might reach some form of ...
MPIchael's user avatar
  • 2,621
1 vote

fastest linear system solve for small square matrices (10x10)

I would try blockwise inversion. https://en.wikipedia.org/wiki/Invertible_matrix#Blockwise_inversion Eigen uses an optimized routine to calculate the inverse of a 4x4 matrix, which is probably the ...
Charlie S's user avatar
  • 661
1 vote

Which Linux OS for computer science and numerical analysis

I use Ubuntu 18.04 at work and Manjaro Arch Linux on my laptop. I use MATLAB, C++, and Julia ...
Alec Hoyland's user avatar
1 vote
Accepted

standard directory for compiling scientific libraries

I don't think there's any one right answer here. I tend to put non-system libraries in /opt, then add link directives for them manually to the Makefiles etc of whatever apps are looking for them (eg, ...
rchilton1980's user avatar
  • 4,794
1 vote

How to Run MPI-3.0 in shared memory mode like OpenMP

I also found this link on Stack Overflow. I swear I looked for questions like mine for forever but it seems the best way to search a question on stack overflow is to start to make a question and it ...
Franklin Betten's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible