Most Popular

1500 questions
170
votes
8 answers

Recommendations for a usable, fast C++ matrix library?

Does anyone have recommendations on a usable, fast C++ matrix library? What I mean by usable is the following: Matrix objects have an intuitive interface (ex.: I can use rows and columns while indexing) I can do anything with the matrix class that…
Geoff Oxberry
  • 30,394
  • 9
  • 64
  • 127
105
votes
14 answers

Is it worthwhile to write unit tests for scientific research codes?

I am strongly convinced of the value of using tests that verify a complete program (e.g. convergence tests), including an automated set of regression tests. After reading some programming books, I've gotten the nagging feeling that I "ought to"…
David Ketcheson
  • 16,522
  • 4
  • 54
  • 105
97
votes
19 answers

Is there a high quality nonlinear programming solver for Python?

I have several challenging non-convex global optimization problems to solve. Currently I use MATLAB's Optimization Toolbox (specifically, fmincon() with algorithm='sqp'), which is quite effective. However, most of my code is in Python, and I'd…
David Ketcheson
  • 16,522
  • 4
  • 54
  • 105
93
votes
10 answers

What kinds of problems lend themselves well to GPU computing?

So I've got a decent head for what problems I work with are best one in serial, and which can be managed in parallel. But right now, I don't have much of an idea of what's best handled by CPU-based computation, and what should be offloaded to a…
Fomite
  • 2,383
  • 1
  • 18
  • 25
79
votes
5 answers

How much better are Fortran compilers really?

This question is an extension of two discussions that came up recently in the replies to "C++ vs Fortran for HPC". And it is a bit more of a challenge than a question... One of the most often-heard arguments in favor of Fortran is that the compilers…
Pedro
  • 9,573
  • 1
  • 36
  • 45
71
votes
5 answers

How do I take the FFT of unevenly spaced data?

The Fast Fourier Transform algorithm computes a Fourier decomposition under the assumption that its input points are equally spaced in the time domain, $t_k = kT$. What if they're not? Is there another algorithm I could use, or some way I could…
David Z
  • 3,383
  • 2
  • 27
  • 34
69
votes
10 answers

What are some good strategies for improving the serial performance of my code?

I work in computational science, and as a result, I spend a non-trivial amount of my time trying to increase the scientific throughput of many codes, as well as understanding the efficiency of these codes. Let's assume I have evaluated the…
Aron Ahmadia
  • 6,951
  • 4
  • 34
  • 54
67
votes
13 answers

C++ vs Fortran for HPC

In my computational science PhD program, we are working almost exclusively in C++ and Fortran. It seems like some professors prefer one over the other. I am wondering which one is 'better' or if one is better than the other in a certain…
drjrm3
  • 2,139
  • 2
  • 19
  • 22
61
votes
4 answers

How mature is the "Julia" scientific computing language project?

I'm considering learning a new language to use for numerical/simulation modelling projects, as a (partial) replacement for the C++ and Python that I currently use. I came across Julia, which sounds kind of perfect. If it does everything it claims, I…
N. Virgo
  • 1,223
  • 1
  • 10
  • 23
58
votes
4 answers

What guidelines should I follow when choosing a sparse linear system solver?

Sparse linear systems turn up with increasing frequency in applications. One has a lot of routines to choose from for solving these systems. At the highest level, there is a watershed between direct (e.g. sparse Gaussian elimination or Cholesky…
J. M.
  • 3,155
  • 28
  • 37
58
votes
7 answers

Is it a good idea to use vector> to form a matrix class for high performance scientific computing code?

Is it a good idea to use vector> (using std) to form a matrix class for high performance scientific computing code? If the answer is no. Why? Thanks
cfdgeek
  • 713
  • 1
  • 5
  • 5
58
votes
17 answers

Is it common not to use libraries for standard numerical algorithms, and why?

A lot of numerical algorithms (integration, differentiation, interpolation, special functions, etc.) are available in scientific computation libraries like GSL. But I often see code with "hand-rolled" implementations of these functions. For small…
David Z
  • 3,383
  • 2
  • 27
  • 34
57
votes
3 answers

Why is division so much more complex than other arithmetic operations?

I recently encountered a case where I needed an integer division operation on a chip that lacked one (ARM Cortex-A8). While trying to research why that must be, I found out that in general division takes many more cycles than addition, subtraction…
Phonon
  • 673
  • 1
  • 5
  • 8
56
votes
3 answers

What are the conceptual differences between the finite element and finite volume method?

There is an obvious difference between finite difference and the finite volume method (moving from point definition of the equations to integral averages over cells). But I find FEM and FVM to be very similar; they both use integral form and average…
boyfarrell
  • 5,409
  • 3
  • 35
  • 67
56
votes
7 answers

What core skills should every computational scientist have?

Every scientist needs to know a bit about statistics: what correlation means, what a confidence interval is, and so on. Similarly, every scientist ought to know a bit about computing: the question is, what? What it is reasonable to expect every…
Greg Wilson
  • 209
  • 4
  • 5
1
2 3
99 100