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

learn more… | top users | synonyms

3
votes
1answer
40 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
113 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
83 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
94 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
144 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
151 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
124 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
131 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
203 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
213 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
91 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
3k 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
300 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 ...
9
votes
3answers
271 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
714 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
166 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
81 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
104 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
147 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
121 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
330 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. ...
9
votes
1answer
318 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 ...
21
votes
0answers
432 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
229 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
438 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
222 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
155 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
223 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
1k 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
421 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
141 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
91 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
270 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
122 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
167 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
823 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
211 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
320 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
376 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
230 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
2k 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 ...
37
votes
8answers
4k views

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 ...
10
votes
4answers
1k views

Portable multicore/NUMA memory allocation/initialization best practices

When memory bandwidth limited computations are performed in shared memory environments (e.g. threaded via OpenMP, Pthreads, or TBB), there is a dilemma of how to ensure that the memory is correctly ...
4
votes
3answers
98 views

Whats wrong with my running time calculation?

I am running a linear algebra iterative method (PCG) for solving Ax=b, the dimension of the matrix is 10000x10000. So, I did 2 preliminary analyses: Memory Analysis The size of the matrix ...
6
votes
4answers
998 views

Are DAXPY, DCOPY, DSCAL overkills?

I have implemented CG in FORTRAN by linking it to Intel MKL. When there are statements like: (Refer Wikipedia) p=r; x=x+alpha*p r=r-alpha*Ap; or similar ...
2
votes
2answers
574 views

Contiguous prime numbers with MPI (Want more ideas for an efficient algorithm)

I am a programmer. I am working with Message Passing Interface (MPI) in C. I do a program that consist on finding the contiguous prime from 1 to 10,000,000. I already do it! but I do it with trial ...
10
votes
5answers
833 views

To what extent is generic and meta-programming using C++ templates useful in computational science?

The C++ language provides generic programming and metaprogramming through templates. These techniques have found their way into many large-scale scientific computing packages (e.g., MPQC, LAMMPS, ...