multithreading with python - Grasshopper2024-03-29T05:21:48Zhttps://www.grasshopper3d.com/forum/topics/multithreading-with-python?feed=yes&xn_auth=noHi Nik
thanks for the feedbac…tag:www.grasshopper3d.com,2016-07-15:2985220:Comment:15666042016-07-15T16:42:47.090ZGiulio Piacentinohttps://www.grasshopper3d.com/profile/GiulioPiacentino
<p>Hi Nik</p>
<p>thanks for the feedback. <em>RhinoCommon</em> can be overwhelming, while <em>ghcomponentlib</em> is used a lot because it is structured exactly like Grasshopper. It is also the only way to access, say, Voronoi or any third-party add-on. The default is still what you are able to access. Is there a function in particular that is giving you grief?</p>
<p>Just something to watch for: we cannot use normal lists in parallel. It is not safe. Things might just not work. Also, sorting…</p>
<p>Hi Nik</p>
<p>thanks for the feedback. <em>RhinoCommon</em> can be overwhelming, while <em>ghcomponentlib</em> is used a lot because it is structured exactly like Grasshopper. It is also the only way to access, say, Voronoi or any third-party add-on. The default is still what you are able to access. Is there a function in particular that is giving you grief?</p>
<p>Just something to watch for: we cannot use normal lists in parallel. It is not safe. Things might just not work. Also, sorting is non-threaded, so adding a sort afterwards (if elements are many) will be very expensive and on one thread, again.</p>
<p>Just some ideas,</p>
<p>Giulio<br/>--<br/>Giulio Piacentino<br/>for Robert McNeel & Associates<br/>giulio@mcneel.com</p> Great news. But learning Rhin…tag:www.grasshopper3d.com,2016-07-14:2985220:Comment:15661932016-07-14T23:25:02.970ZNik Willmorehttps://www.grasshopper3d.com/profile/NikFromNYC
Great news. But learning Rhinocommon opens up a lot more command options like tolerance and what about the old problem that node-in-code can only access the default mode of a component that has options for several in its little tag along the component bottom?<br />
<br />
One aspect to parallel I had to appreciate was having to add an index entry paired to my input data that survived the parallel function reordering of an input list, so I could re-sort the output to correspond to the input list.
Great news. But learning Rhinocommon opens up a lot more command options like tolerance and what about the old problem that node-in-code can only access the default mode of a component that has options for several in its little tag along the component bottom?<br />
<br />
One aspect to parallel I had to appreciate was having to add an index entry paired to my input data that survived the parallel function reordering of an input list, so I could re-sort the output to correspond to the input list. Good news! The library is now…tag:www.grasshopper3d.com,2016-07-14:2985220:Comment:15660982016-07-14T16:23:12.867ZGiulio Piacentinohttps://www.grasshopper3d.com/profile/GiulioPiacentino
<p>Good news! The library is now rewritten in Rhino WIP. <a href="http://discourse.mcneel.com/t/new-version-of-ghpythonlib-components/34619" target="_blank">http://discourse.mcneel.com/t/new-version-of-ghpythonlib-components/34619</a></p>
<p>Good news! The library is now rewritten in Rhino WIP. <a href="http://discourse.mcneel.com/t/new-version-of-ghpythonlib-components/34619" target="_blank">http://discourse.mcneel.com/t/new-version-of-ghpythonlib-components/34619</a></p> Yes, thank you for the links,…tag:www.grasshopper3d.com,2015-07-24:2985220:Comment:13317072015-07-24T22:49:25.740Zdustinhttps://www.grasshopper3d.com/profile/dustin836
<p>Yes, thank you for the links, Andrew, definitely helpful in explaining the behavior we were getting.</p>
<p>Yes, thank you for the links, Andrew, definitely helpful in explaining the behavior we were getting.</p> Thanks for the reply and tips…tag:www.grasshopper3d.com,2015-07-14:2985220:Comment:13259282015-07-14T17:04:50.979ZJonah Hawkhttps://www.grasshopper3d.com/profile/jonahhawk
<p>Thanks for the reply and tips Andrew. I've wondered why there are not heaps of posts using .parallel. I've suspected that we may have to write our own ray intersect function to get this to work reasonably fast.</p>
<p>Thanks for the reply and tips Andrew. I've wondered why there are not heaps of posts using .parallel. I've suspected that we may have to write our own ray intersect function to get this to work reasonably fast.</p> in my experience, ghpythonlib…tag:www.grasshopper3d.com,2015-07-14:2985220:Comment:13256292015-07-14T14:23:33.228ZAndrew Heumannhttps://www.grasshopper3d.com/profile/AndrewHeumann
<p>in my experience, ghpythonlib.components and ghpythonlib.parallel are NOT FRIENDS. You can pretty readily parallelize rhinocommon functions - but trying to parallelize the "virtual component" logic from a grasshopper component seems to cause some kind of memory leak, with progressively worse performance. </p>
<p></p>
<p>See also these posts: …</p>
<p></p>
<p>in my experience, ghpythonlib.components and ghpythonlib.parallel are NOT FRIENDS. You can pretty readily parallelize rhinocommon functions - but trying to parallelize the "virtual component" logic from a grasshopper component seems to cause some kind of memory leak, with progressively worse performance. </p>
<p></p>
<p>See also these posts: </p>
<p><a href="http://discourse.mcneel.com/t/ghpython-parallel-component-slower-than-native-ghopper-module/6360" target="_blank">http://discourse.mcneel.com/t/ghpython-parallel-component-slower-than-native-ghopper-module/6360</a></p>
<p><a href="http://discourse.mcneel.com/t/new-ghpython-issues-crashing-multithreading-performance/4817" target="_blank">http://discourse.mcneel.com/t/new-ghpython-issues-crashing-multithreading-performance/4817</a> </p>
<p></p>