7

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 information allows the compiler to do full or partial loop unrolling, eliminating lots of branch instructions. If you're looking at using an existing library rather ...


6

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 distribution and window manager that you pick will work with the software packages that matter to you. It's also important to understand how the distribution you pick is ...


5

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 (since I'm not that familiar with C++) #if __STDC_VERSION__ >= 199901L #define _XOPEN_SOURCE 700 #else #define _XOPEN_SOURCE 600 #endif /* __STDC_VERSION__ */ #...


5

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 intermediate double precision operations, even when the source variables are single precision and the output location (left-hand side destination) is single precision. ...


5

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 bit beefier due to being the single point of contact of users to the cluster. A well maintained cluster will also have a good documentation of the system, for ...


5

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 complex numbers. This means calling code compiled with one compiler from another one is not guaranteed to do what you expect, and can lead to grabbing the wrong bit ...


5

Ask your remote host to install what you need. We do this all the time for folks where I work. Typically they can help you out. Also, it's OK to do some of your development on your machine and then port your results to the remote machine.


4

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.. basically taking the k/i/j loop nest and flattening it into O(1000) or so lines of scalar arithmetic. Then feed that generated program into whichever ...


4

I want to add something not mentioned yet here that might be useful (too long for a comment), because you say that syncing with git is a pain. There is the tool sshfs (and I believe its osx equivalent is osxfuse). If your remote machine allows ssh connections, sshfs will be able to mount the remote filesystem locally over ssh. This is useful if, as I think ...


4

I realize this answer is probably far, far too late, but for aggressive optimization, the "-fast" option seems like the easiest solution. Excerpts from the man page: -fast Maximizes speed across the entire program. Description: This option maximizes speed across the entire program. It sets the following options: - On Linux* systems: -...


4

There are multiple possible explanations: with floats and doubles the different number of computations happen due to, say, number of iterations/function evaluations (or something else, as pointed out by @Richard in the comments) there is some type conversions/implementations (say templated code) that are non-optimal with float types as opposed to doubles. I ...


3

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 you 10 or 20% but not something that's going to make a meaningful difference. What you ought to do is go back to the original formula you're trying to implement....


3

Suppose a program was written in two distinct languages, let them be language X and language Y, if their compilers generate the same byte code, why I should use language X instead of the language Y? Programmer productivity is important. If it's easier to get the job done with language X -- which could be for various reasons, like syntax, libraries, tools -- ...


2

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 you have pointed out, rewriting a conditional to use boolean arithmetic involves computing every possible branch, then computing a kind of weighted sum; this ...


2

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 branches; they would then see if perhaps what remains in the computation of the assignments is simple enough to have a formulaic expression that allows computation without branching, or through a ...


2

The questions you ask, in general, are quite difficult to answer because there are just too many languages for so many things. Each language has been built either to satisfy some necessity or for some intended audience. Also, even for general-purpose languages I think these are built in a way it can serve better to a particular subgroup. Anyway, I don't ...


2

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 requirements are complex, then it can still be difficult to manage all the software installations using your OS package managers. My strategy is like this. ...


2

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 are symmetric, a Cholesky decomposition is more efficient than LU. When you only need a limited amount of accuracy an iterative method can be faster. Second, ...


1

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 concurrency by evoking the method in parallel. If you do not re-use your output y[100] as an input x[10] to the function then nobody stops you from executing it within ...


1

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 best you're going to get. Try using that as much as possible. http://www.eigen.tuxfamily.org/dox/Inverse__SSE_8h_source.html Top left: 8x8. Top right: 8x2. ...


1

I use Ubuntu 18.04 at work and Manjaro Arch Linux on my laptop. I use MATLAB, C++, and Julia for my work. MATLAB works fine on both operating systems, though you may have to play with the drivers on Ubuntu in order to get good-looking plots. Naturally, C++ and Julia work great on both OSes. MATLAB also runs fine, though if you intend to use the Coder or MEX ...


1

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, add -L/opt/path/to/metis and -lmetis to the Makefile of MA57). It's a compromise between putting it somewhere easy to find, but trying to be hygienic and keep ...


1

ME57 should come with a configure script, so the usual ./configure; make; make install should just work. I tried it just now using GCC 4.9.0-7 on Debian testing.


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