0

I am writing a C code in Linux (maybe later in Windows) and the code includes massive Linear Algebra computations with parallel processing. I am using GotoBLAS2 which handles lots of jobs. Still there are some matrix computations (especially sparse matrices) which should be carried out manually. I searched the internet and found out some libraries such as Open MP. Also, it seems that threading can be helpful. What would be the best approach for parallel computation in C? Thanks

Additional information about my code: I am specially concerned about Sparse Matrix-Vector multiplications. Also, I have a large set of vectors {v1, v2, v3, v4, ...} and these vectors should be multiplied by different numbers, which can be carried out using parallel computation. Thanks

Pouya
  • 1,871
  • 3
  • 20
  • 25
  • Maybe you should provide some example code of the things you intend to do, or what you have now. This is quite vague. – hyde Jan 26 '13 at 22:17
  • "sparse matrix computations" can be performed by BLAS routines - so why should they be carried out manually? – Floris Jan 26 '13 at 22:18
  • How can I do sparse matrix-vector computation using BLAS? That would be excellent since GotoBLAS is highly optimized. – Pouya Jan 26 '13 at 22:41
  • See [this earlier answer](http://stackoverflow.com/questions/2222549/best-c-matrix-library-for-sparse-unitary-matrices) – Floris Jan 27 '13 at 00:54

1 Answers1

3

This is really a "discussion" type question, rather than a "here is a problem; who can help me solve it?" type. "The best approach" is subjective. I like OMP a lot - it handles a lot of thread management for you. In the end, "the best" is what you can use effectively. A powerful tool in the wrong hands is no good. You can learn enough OMP in a day to speed up some key loops by almost the number of processors on your machine - that gets it my vote.

Floris
  • 45,857
  • 6
  • 70
  • 122