0
votes

I want to solve 10 linear systems (Ax = b) in each iteration of an algorithm.

The A of each system is about 10 x 11 (over-determined).

Cpu has 8 cores.

If I ask each CPU solve one of the 10 linear systems, 6 cpu has to wait for solving the last 2 systems.

If I solve each system one by one with multi-threaded solvers, would the performance be quite bad? I worry about false-sharing because the matrices A are small.

Does Eigen have a multi-threaded solver for this situation?

Thanks again.

1
Should I pad b and A with zeros? - R zu
Is it the same A for each system? - dmuir
Not the same A. - R zu
Padding A may make sense to give it a size which is a multiple of the SIMD-packet size on your architecture (e.g., a multiple of 8, if you use float and AVX) -- but that depends on the solver you are using (you need to benchmark if it makes sense, of course). - chtz

1 Answers

2
votes

Trying to leverage multi-threading within such tiny problems (10 x 11) will only slow down things. If you want to do better than running the 10 solves in parallel, then try to find more parallel tasks within your pipeline.