Questions about the execution speed and memory usage of algorithms, data structures, languages and libraries.

learn more… | top users | synonyms

0
votes
2answers
40 views

Impact of frequent row major / column major conversions using LAPACK/BLAS?

If you call a library like LAPACK or BLAS (which are written in FORTRAN and use column major order) from a C-like language that uses row major order, won't you lose performance and use a lot of memory ...
1
vote
2answers
95 views

Lua and Fortran (or Python) I/O

I am writing a global climate simulation software system. My idea is the following : At the top of everything, I interface to the OS using D, a very powerful language for compile time code ...
3
votes
1answer
58 views

Does it make sense to build ATLAS from source on a cloud machine?

ATLAS is an extremely popular linear algebra library. When you install ATLAS from source, it tries to automatically tune a number of parameters to give you the fastest code. Does it make sense to do ...
3
votes
1answer
89 views

Fortran 90/95: Deallocating variables

I understand the crucial importance of freeing memory when certain variables or arrays need to be reused later in the program, or may not be in use for a while. However, in my experience with ...
1
vote
2answers
60 views

Performance metrics to compare initial-boundary value problem solutions

I am comparing the performance several finite difference methods of solving an initial-boundary value problem. There are several dimensions to this comparison: Number of cells Number of timesteps ...
4
votes
1answer
92 views

Fast way to repeatedly solve a small nonlinear equation system

A small nonlinear equation system (sizes around 12 ✕ 12) needs to be solved repeatedly (millions of times); each time with some variation in parameters/coefficients (although the equation set is ...
3
votes
2answers
93 views

Finding the minimum hamming distance between a bit vector and any pairwise intersection of multiple bit vectors

I'm looking for a way to optimize this procedure. This is the problem: I have a list of bit vectors $\mathbf{A} = [ a_1, a_2, a_3, ..., a_n ]$ I have a list of bit vectors $\mathbf{B} = [ b_1, b_2, ...
2
votes
2answers
125 views

Why is computational cost measured in Floating Pt. Ops. in times of parallel computing?

In times of parallel computing, it seems to me that algorithms (also basic ones, like matrix-vector multiplication) should be measured by their dependent steps (that use results from steps before) ...
3
votes
1answer
97 views

Increasing thread number degrades performance

I have a problem with parallelization and the brownian dynamics (molecular dynamics) code that I am using. We have our own home-grown framework at the university, and recently we've made the change ...
7
votes
1answer
107 views

WELL pseudo-random number generations

I've used MT19937 in a test harness to generate uniformly (unsigned) 32-bit [0, $2^{32}$- 1] values, based on the original Authors' mt19937.c implementation, to ...
4
votes
1answer
201 views

What is the best way to multiply a diagonal matrix (in fortran)

What is the best way to compute: $$ Y = D X $$ where $D \in \mathbb{R}^{m\times m}$ is diagonal and $X \in \mathbb{C}^{m \times n}$ is general. I am mostly interested in these two cases: $m ...
2
votes
2answers
154 views

Ways to speed up the computations

OK, I have a FORTRAN code which numerically integrates equations of motion for large data sets of initial conditions. I run this program in my PC and it requires about 1 day of computations per data ...
3
votes
1answer
127 views

What is the correct way of performing numerical experiments on desktops?

Suppose I want to set up an experiment to measure the performance of some numerical code on a desktop machine running Linux/Windows/MacOS. What kind of environment should I arrange in order to get ...
0
votes
0answers
19 views

Differences between methods for solving linear equation system [duplicate]

I have a huge linear equation system in this form: F=K.Δ as usual form of problems in the finite element method, where the F vector and K are known and Δ vector is unknown. There are several methods ...
4
votes
1answer
96 views

What is the added cost of generalizing an eigensystem?

Problem Let's say I can write a model as the Hermitian eigensystem: $$ A x = \lambda x $$ where $A \in \mathbb{C}^{n\times n}$ is Hermitian, or as the generalized Hermitian eigensystem: $$ \tilde A ...
4
votes
1answer
136 views

Using PAPI in PETSc code

I am trying to count the number of cache misses, total cycles, etc. per iteration of a for loop inside MatMult_SeqSBAIJ_2() . ...
6
votes
2answers
223 views

Why performance is given in Gflop/s rather than actual time in seconds

While reading many research-papers comparing parallel implementations of algorithms on different machines/architectures, I have noticed that the performance comparison is always listed in terms of ...
8
votes
2answers
222 views

What is the underlying structure of scientific code performance?

Consider two computers with different hardware and software configurations. When running the exact same serial Navier-Stokes code on each platform it takes x and y time to execute one iteration for ...
6
votes
1answer
92 views

Measures of parsimony for numerical models?

There are hundreds of different types of performance measures for numerical models, many of which are applicable to many different types of models. But a good model doesn't just perform well, it ...
6
votes
3answers
4k views

Nvidia K20X vs GeForce Titan for GPGPU acceleration

Im trying to understand the difference between these two graphics cards for academic computing, specifically for the DGEMM component. If we look at the raw statistics, both have the same GK110 chip, ...
13
votes
3answers
326 views

Comparison of iteration methods: number of iterations vs. cpu time

I am comparing two iterative methods for inverting random square matrices. Since the matrices are random, every test case takes both different amounts of iterations and different elapsed times. My ...
11
votes
3answers
304 views

Is there any benefit to compiling LAPACK from source versus installing the prebuilt package from Ubuntu?

I know that ATLAS is able to optimize itself for the machine it is compiled on and thus maximum benefits are found by compiling from source. Is there any benefit to compiling LAPACK from source? It ...
8
votes
1answer
1k views

What is the fastest way to compute all eigenvalues of a very big and sparse adjacency matrix in python?

I'm trying to figure out if there is a faster way to compute all the eigenvalues and eigenvectors of a very big and sparse adjacency matrix than using scipy.sparse.linalg.eigsh As far as I know, this ...
5
votes
1answer
186 views

Reference BLAS/LAPACK from NETLIB is twice as fast as MKL for complex numbers

I'm solving the Helmholtz equation using PETSc. I found with the PETSc configure option --download-f-blas-lapack my program runs twice as fast over running it with ...
2
votes
0answers
93 views

Prediction model on GPU [closed]

I am doing a small project at school. I have done my code implementations in CUDA and did some performance measurements with real values, i.e. running the program with different number of threads, ...
2
votes
2answers
114 views

Speedup prediction of rotating mask filter

I am trying to do the speed up analysis of the rotating mask filter (section 4.2.3). Let $N^2$ be the pixels in the image and let $m^2$ be the neighborhood of a given pixel, what I have for my ...
8
votes
2answers
154 views

How do Volkov and Demmel experimentally determine the latencies, line sizes, and page sizes of a GPU?

In "LU, QR and Cholesky Factorizations using Vector Capabilities of GPUs", by Vasily Volkov and James Demmel, there is an interesting way to interpret the latencies, line sizes, and page sizes of a ...
3
votes
3answers
125 views

How do I get reliable timing data for time spent in function calls in my code?

This question is a follow-up to Fortran: Best way to time sections of your code?. If I want to time functions in my code, I know I could use gprof or kcachegrind. I also know that the results from ...
3
votes
1answer
373 views

Effecient CFD programming techniques

I'm trying to make highly efficient CFD programming complex for solving combustion problems. I've finished writing core which realises mathematical model, and now I'm concerned about code performance. ...
10
votes
1answer
359 views

What is the impact of C++11 move semantics in the context of scientific computing?

C++11 introduces move semantics which can, for example, improve code performance in situations where C++03 would need to perform a copy construction or copy assignment. This article reports that ...
20
votes
1answer
512 views

How does the performance of Python/Numpy array operations scale with increasing array dimensions?

How do Python/Numpy arrays scale with increasing array dimensions? This is based on some behaviour I noticed while benchmarking Python code for this question: How to express this complicated ...
6
votes
5answers
237 views

Evaluate the sum

I want to evaluate the sum $$\sum_{k=1}^\infty \left(\frac{i+1}{\sqrt{2}}\right)^k\cdot k^{-\alpha}$$ where $i=\sqrt{-1}$ and $\alpha\in[\frac{3}{4},1]$ with 8 digits accuracy. If I am willing to ...
10
votes
5answers
502 views

Calculation of the sparsity structure for finite element matrices

Question: What methods are available to accurately and efficiently calculate the sparsity structure of a finite element matrix? Info: I'm working on a Poisson Pressure Equation solver, using ...
2
votes
0answers
248 views

Cusp Library performance worse than PETSC (GMRES 200 iterations) Why?

I wanted to compare the speeds of the GMRES implementations in the CUSP and the PETSc libraries. The matrix (A) used for testing was a 3d Laplacian matrix obtained by using the 7 point stencil on a ...
10
votes
1answer
160 views

Statistical models for local memory/compute, network latency, and bandwidth jitter in HPC

Parallel computation is frequently modeled using a deterministic local rate of computation, latency overhead, and network bandwidth. In reality, these are spatially variable and non-deterministic. ...
10
votes
2answers
225 views

Literature references for modeling current and future energy costs of floating-point operations and data transfers

I am searching for the most important literature and slide references for modeling current and future energy costs of floating-point operations and data transfers across the CPU, memory, network, and ...
7
votes
2answers
2k views

Memory usage in fortran when using an array of derived type with pointer

In this sample program I'm doing the same thing (at least I think so) in two different ways. I'm running this on my Linux pc and monitoring the memory usage with top. Using gfortran I find that in the ...
4
votes
1answer
517 views

How to get sparse complex matrices from my code to PETSc efficiently

What is the most efficient way to get a complex sparse matrix from my Fortran code to PETSc? I understand that this is problem dependent, so I tried to give as many relevant details as possible below. ...
5
votes
1answer
172 views

Open source implementation of rational approximation to a function

I am looking for some open source implementation (any of Python, C, C++, Fortran is fine) of rational approximation to a function. Something along the article [1]. I give it a function and it gives me ...
4
votes
1answer
99 views

Efficient way to find max height repetitive sub-trees in an object tree

I am trying to solve a problem of finding a max repetitive sub-tree in an object tree. By the object tree I mean a tree where each leaf and node has a name. Each leaf has a type and a value of that ...
9
votes
2answers
283 views

Fastest way to find eigenpairs of a small nonsymmetric matrix on a GPU in shared memory

I have a problem where I need to find all positive (as in the eigenvalue is positive) eigenpairs of a small (usually smaller than 60x60) nonsymmetric matrix. I can stop calculating when the eigenvalue ...
3
votes
2answers
126 views

Efficiently changing basis on many diagonal matrices

I have to perform a [complex] basis transformation on a large number of [real] diagonal matrices: $$ \langle b_i | A | b_j \rangle = \sum_k \langle b_i | \bar{b}_k\rangle \langle\bar{b}_k | A | ...
6
votes
2answers
169 views

How should I report profiling/timing information about my code?

I've seen a lot of publications in Computational Physics journals use different metrics for the performance of their code. Especially for GPGPU code, there seems to be a great variety of timing ...
20
votes
3answers
884 views

What tools or approaches are available to speed up code written in Python?

Background: I think I might want to port some code that calculates matrix exponential-vector products using a Krylov subspace method from MATLAB to Python. (Specifically, Jitse Niesen's expmvp ...
5
votes
1answer
236 views

Intersection of hyperplanes

A very basic question but i couldn't find another post about it: Given $p$ non parallel hyper-plane in $\mathbb{R}^p$: $\left(\begin{array}{cccc} c_{11} & a_{11} & .... & a_{1p} \\ ... ...
8
votes
2answers
364 views

What is the overhead in sparse matrix multiplication

Does matrix multiplication (both Mat*Mat, and Mat*Vec) scale with number of non-zeros, or with the size of the matrix? Or some combination of the two. What about with shape. For example, I have a ...
4
votes
2answers
405 views

How should I build a 2D 5-point stencil Laplacian matrix in parallel?

I'm making a simple eigenvalue solver with SLEPc, using a 5-point stencil and the finite difference method. I want to be able to assemble the matrix in parallel. My first thought was just to use ...
10
votes
3answers
236 views

How to implement efficient indexing function for two particle integrals <ij|kl>?

This is a simple symmetry enumeration problem. I give the full background here, but no knowledge of quantum chemistry is needed. The two particle integral $\langle ij|kl\rangle$ is: $$ \langle ...
10
votes
3answers
3k views

MATLAB matrix multiplication (the best computational approach)

I have to make a coordinates transformation between two reference systems (axes). For it, three matrices (3x3) have to be multiplied due to some intermediate axes being used. I have thought about two ...