I finally got a section of my code to run in parallel with OpenMP without errors. When I dep开发者_运维问答loyed the dll to another machine, however, it no longer ran in parallel.
Logging reveals that omp_in_parallel() == 0
on the other machine but not on mine.
My machine is using an Intel i5 CPU which has 2 hyperthreaded cores for an effective omp_get_numProcs() == 4
. The other is a virtual machine with 2 processors assigned to it on Microsoft Server 2008, thus omp_get_numProcs() == 2
.
Are there known settings which would make a program run in parallel under certain values and not others?
I had enabled OpenMp in Debug mode but not in Release. The deployed dll was in Release mode while I was testing it on my machine in Debug configuration.
You'd think I would have learned after the last time this happened. :-)
Thank you for your answers and my apologies for wasting your time.
精彩评论