custom VEX multithreading

   6237   7   1
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
hi all..

I'm pretty sure this is a FAQ, but my custom VEX SOP is called on the same thread for each point. Is there a way to inform Houdini that the SOP can be called on multiple threads?

thanks!
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
User Avatar
Member
2199 posts
Joined: July 2005
Offline
Have you set it to use 1 thread per processor? It's in the number of threads drop down menu automatically included in the parameters of every vex node.
VEX is SIMD compiled so every vex node can run multi-threaded.
The trick is finding just the right hammer for every screw
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
Got it - thanks .

I was expecting a multi-threaded/single-threaded toggle in the HDK since this SOP should always run multi-threaded and benefits from as many processors as are available (it doesn't place a heavy load on them.. it just runs better). Is there a way to do this rather than setting a specific number of processors for each instance of this type on each box?

As a kludge i was thinking of changing the default number of processors in the type properties to 99, but it doesn't let me edit the channel settings. I'm using the “File:New Operator Type..” method to create the SOP. Maybe it wouldn't work anyway..

Out of idle curiosity, what happens if i create a hip on a box with 2 processors and throw it on boxes in the Amazon farm with 4 processors or 1 processor? In the former case i'm hoping that Houdini creates 2 processors .
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
User Avatar
Staff
2595 posts
Joined: July 2005
Offline
david_aiken
Got it - thanks .

I was expecting a multi-threaded/single-threaded toggle in the HDK since this SOP should always run multi-threaded and benefits from as many processors as are available (it doesn't place a heavy load on them.. it just runs better). Is there a way to do this rather than setting a specific number of processors for each instance of this type on each box?

As a kludge i was thinking of changing the default number of processors in the type properties to 99, but it doesn't let me edit the channel settings. I'm using the “File:New Operator Type..” method to create the SOP. Maybe it wouldn't work anyway..

Out of idle curiosity, what happens if i create a hip on a box with 2 processors and throw it on boxes in the Amazon farm with 4 processors or 1 processor? In the former case i'm hoping that Houdini creates 2 processors .

Choose the “1 per processor” setting, then it will create one thread per processor.
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
hmm.. perhaps i'm doing something wrong. I print the point number from within the VEX SOP c++ code and even when the number of threads is set to 4 or 1 per processor the point numbers are printed out in order each time. I'm running on ubuntu 9.10 64-bit, Houdini Apprentice 10.0.595.

btw - thanks for clearing that up Mark.. i posted at the same time
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
I tried using the standard VEX_Ops.C example using hcustom and had the same behaviour. Perhaps due to some misunderstanding on my part, but i've logged a bug. If anyone has this working please let me know.
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
User Avatar
Staff
5164 posts
Joined: July 2005
Offline
Do you have enough points in your model? VEX processes points in batches (256, I believe), so you'd need a significant number to see any threading benefit. Threading is also only worth it if the amount of work you're doing per-point is significant, otherwise it really has no effect (or could even slow things down).
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
Thanks - i wasn't aware of the batching. A 10x100 grid shows the proper behaviour.

I'm interested in threading because i want to transfer the geometry data to a GPU. Is there a good way to do this?
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
  • Quick Links