Home › Forum › SOFA › Using SOFA › [SOLVED] How to use ParallelVisitorScheduler
Tagged: Multithreading
- This topic has 6 replies, 4 voices, and was last updated 7 years, 11 months ago by Hugo.
-
AuthorPosts
-
22 January 2016 at 01:27 #5364GaribaldeBlocked
I am trying to parallelize the visitors. I see that there is already a class created for this ParallelVisitorScheduler. However i am no sure how use it. I need to replace the existing executeVisitor() with the one from ParallelVisitorScheduler. How would i do this? is there a function association?
Thanks
3 February 2016 at 15:30 #5528GuillaumeKeymasterHi Garibalde,
Mixing threads and Visitors is a complex and still running task.
I just had a look at ParallelVisitorScheduler. This is a very old abstract class created in 2007 and not used anymore in SOFA.
Still, the algorithm looks OK so you should be able to use it : simply create your own Scheduler inheriting from ParallelVisitorScheduler and specify what to do with threadsafe Visitors inexecuteParallelVisitor()
function.
Then, to use it, replace yournode->execute(visitor)
calls toMyPVS::executeVisitor(node, visitor)
calls.Unfortunately that’s all I can say since I’m not yet a SOFA expert.
Could someone else help us here ?Hope it helps,
Guillaume4 February 2016 at 19:02 #5545fspadoniBlockedHi Garibalde,
ParallelVisitorScheduler was developed for a project to parallelize SOFA using KAAPI multithreading library http://kaapi.gforge.inria.fr/ but there is no more support.
As far as I know no one is still working on it.
I implemented in my project some basic task based parallelism in Sofa using the Multithreading plugin.
That’s not a default SOFA plugin and it has a boost thread library dependency.
Maybe it can be helpfulFederico
5 February 2016 at 00:22 #5546GaribaldeBlockedHi fspadoni and Guillaume,
Thanks for your replies.
Fspadoni, Do you use the multthread plugin in SOFA to accomplish this? I would like to paralllelise some of the tasks also in my scene to get better performance.
Any help would be great.
Thanks
Garibalde5 February 2016 at 15:52 #5553fspadoniBlockedYes I used the Multithreading plugin
The plugin provides just a task scheduler to run concurrently tasks and few basic examples of parallelized components.
The scheduler uses the boost thread library internally but you don’t have to deal with threads.
You should decompose your algorithm in tasks.
A task is just a function that can run concurrently with other tasks.Federico
6 June 2016 at 15:18 #7045HugoKeymasterHi @vmenon,
Did you succeed to use the ParallelScheduler as you wanted?
Can we help any further ?Best,
Hugo
20 December 2016 at 00:20 #8220 -
AuthorPosts
- You must be logged in to reply to this topic.