OpenMP - Running parallel code inside parallel code?

It will work fine, but you'll need to enable OpenMP nesting for it to work.

Up vote 7 down vote favorite 1 share g+ share fb share tw.

I have a function compute() that has parallelized matrix multiplication inside of it using OpenMP #pragma omp parallel for This function is called many times in a loop - which I would like to run in parallel. Will there be any issues in running parallel code inside other parallel code? This is c++ compiled on Ubuntu.

C++ parallel openmp link|improve this question asked Sep 7 '11 at 17:18Mikhail2,321217 89% accept rate.

It will work fine, but you'll need to enable OpenMP nesting for it to work. Call omp_set_nested(1); at the start of the program and it will allow you to have nested parallel regions. However: Be aware, that you could end up running many more threads than what you want.

So you will want to limit the # of threads of both the top and inner parallel regions.

2 This is excellent. I forgot the word nested, and couldn't find anything useful. – Mikhail Sep 7 '11 at 17:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions