OpenMP and Blas

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the for book info and to download the examples. Post your feedback about the book and examples to this forum
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help:

OpenMP and Blas

Post by kerbero »

Hi, i need some information about use OpenMP and Blas. Have you got same examples code ?


Re: OpenMP and Blas

Post by jostg »

Please provide more information on what you are trying to do. Calling a pre-built BLAS library within and OpenMP region? Parallel loop? Or do you want to parallelize a BLAS routine with OpenMP?


Re: OpenMP and Blas

Post by ruud »


As Gabriele said, we need more information to help.

There are several vendors that supply an optimized BLAS library. In many cases these have already been parallelized for you. Especially if it is BLAS-2 or BLAS-3. Most likely, OpenMP is used for that so you'll only need to set OMP_NUM_THREADS to use multiple threads.

You could still call such routines from within a parallel region as well, but that implies nested parallelism. You need to check whether this is supported and may have to set OMP_NESTED to TRUE to enable it.

In case you want to parallelize BLAS routines yourself, you may want to leverage what others have done. Some are trivial, but other routines can be pretty complicated.

Kind regards, Ruud