kishchris

I was going thro' MultiThreading topic and in maya doc came across this article which mentioned below
line.
"OpenMP is a higher level threading abstraction primarily designed for data parallelism applied to for loops. It is supported by VS2005 and by the Intel compiler on all platforms. The version of gcc required by Maya on OSX and Linux does not support OpenMP."

My queries is, suppose if we want to make multiThreading plug work for linux. What additional step we have take.

Thanks in advance

chris

Reply 0 0
pshipkov
Nothing really.

include the openMP library
then right above a for loop put the pragma parallel (check online about the exact syntax) and that's it.
Of course - that will be it for simple loops only. More complex data structures require to put a bit of thought how to organize and access the data, etc.
Reply 0 0
kishchris
hey Peter Thanks a lot..
Reply 0 0
ianwaters
If I could just jump in here and add that I've had very mixed results with OpenMP and Maya, while it does indeed make threading an easy task, it also adds rather a lot of instability.

I did some tests using 100% thread safe APIs and had random crashes whenever I enabled OpenMP. Only the simplest of examples worked without crashes.

Now, Autodesk use it quite a bit, so there must be a way to make it work reliably, but I haven't discovered it yet! :)

Ian

PS. Also, as a Mac user, OpenMP is not supported by Xcode 5 (but then neither is Maya, yet!).
Reply 0 0
pshipkov
It works well here.
But you are right, Maya's API is not thread-safe in general and one has to be very careful when and how OMP is used.

I don't use XCode, so cannot comment on the state of things there, but OMP is supported on OSX starting from GCC4.2.1 i believe. I am pretty sure you can get it working through xcode if you have that version of GCC or higher. It is matter of adding extra flag or two to the compiler line.
Reply 0 0
Reply