Parallelism with VEX Wrangles

   2275   3   0
User Avatar
Member
4 posts
Joined: June 2018
Offline
I have noticed that when I set up a VEX wrangle to run over primitives, it only executes on one thread.

I'm currently running this code as a test, and just cranking up the count channel. Flipping between primitive and point, while watching my processors run in htop shows that in point mode it runs on all threads, while in primitive mode it only runs on one.

float num = 0.0;
f@noise = 0.0;

for (int i=0; i<chi("count"); ++i) {
    num += random(i*@primnum);
    f@noise += xnoise(num);
}

Is this a limitation of VEX wrangles, and if so is there a workaround?
User Avatar
Member
49 posts
Joined: Sept. 2013
Offline
Maybe use the opencl node?
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
It's multi threaded for all run over modes, other than ‘detail.’ However, there is a minimum workorder size before it will ask for another thread. I believe it is around 1024 elements required per each additional thread.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
How many primitives?
If it's less than 1000 primitives, it may run in only one thread…
There's at least one school like the old school!
  • Quick Links