2
$\begingroup$

I have a C++ code performing some Armadillo computations in a loop. I'd like to parallelize this loop with OpenMP. But Armadillo automatically uses OpenMP for some computations. So, would the OpenMP parallelized loop cause an issue if I don't disable the automatic Armadillo parallelization ? Or can I safely use the parallelized loop without disabling that?

$\endgroup$
1
$\begingroup$

Nested used of OpenMP is allowed. However, by default the second level will only get a single thread. If that's ok with you, you're good now. If you want the embedded level to be parallel too, set the environment variable OMP_NESTED=true or a function call omp_set_nested(1).

$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.