algorithmic modeling for Rhino
I have been experimenting with multi-threading inside custom C# components. It can be a little unstable if you are calling through to an unsafe function in Rhino, but for the most part they work and allow you to utilise all the processors simultaneously. I wrote a little tutorial (with a sample version of the project to surface node, treaded) over at http://www.nzarchitecture.com/blog/index.php/2011/05/07/threading-g...
The C# component can be downloaded at parametric model.
Tags:
Thanks for posting this. I tried it onto another solar analysis component that I wrote, and the performance gains are massive: it went from a solving time of 9.7s to 1.1s -- ofcourse that's with 12 cores :)
But massively helpful for tasks that are not co-dependent/iterative. Obviously, debugging with this is a royal pain -- only possible if Rhino actually survives the bug (in most instances, it takes me straight to my desktop wallpaper!)
Wow I am surprised by how dramatic your performance gains were Suryansh. 12-cores sounds pretty outrageous but I guess it will be commonplace in a few years, so your project really underscores the significance of multi-threading. I suspect we might even reach a point where Grasshopper models evaluate faster than text-based scripts simply because the Grasshopper schema can be processed in parallel.
Know the crashing feeling well. Forgot if there was a try/catch segment in the code, it might stop some of the bad crashes?
Daniel
Hi RhinoBridges,
> I wonder if all the functions GH may be multi-threading?
As I said in the post, it would be nice to have multi-threading but it is not realistic at the moment. Multi-threading in Grasshopper (or a Grasshopper plugin) can not be supported until Rhino itself is thread-safe. Parts of Rhino V5 are thread-safe but we will probably have to wait until Rhino V6 until all the functions in Rhino (and therefore GH) support mulit-threading.
Daniel
Hi Philipp,
The Grasshopper VB/C# scripts can do anything the Microsoft Common Language Runtime allows and while I havn't done it myself, I suspect this includes running code on the GPU. I would be curious to see how VVVV handles this, I don't think you can just tell the GPU to run a Rhino command? My guess is that you would probably have to recreate the Rhino Command in something like OpenCL and then run the OpenCL. So imagine first writing your own brep-boolean code, and then making it thread safe, and then writing it in the OpenCL language. You might consider doing that if you were building a Rhino competitor, you wouldn't do that to save 10 seconds on a Grasshopper update cycle :)
Daniel
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by