EdArt Posted November 27, 2021 Share Posted November 27, 2021 Hi all, I'm running a simple topological vex function over a mesh, designed for topological symmetry. The function below is run in either a compiled for-loop or a SOP solver, I got the same performance from each: function int[] crawlmesh5(int geo; int basehedge; int reversedir; int baseindex; int foundpts[]; int foundprims[]; ){ int newhedges[]; // early out if prim has been processed int primfound = foundprims[hedge_prim(0, basehedge)]; if (primfound){ return newhedges; } //return newvtxes; int localiter = 0; int currenthedge = basehedge; int vtxpt, lookuptwin; do{ if(localiter > 10){ printf("failsafe-break_"); break; } vtxpt = hedge_dstpoint(0, currenthedge); lookuptwin = foundpts[vtxpt]; if(lookuptwin == -1){ setpointattrib(0, "twin", vtxpt, baseindex); //foundpts[vtxpt] = baseindex; baseindex++; } append(newhedges, hedge_nextequiv(0, currenthedge)); if (reversedir){ currenthedge = hedge_prev(0, currenthedge); } else{ currenthedge = hedge_next(0, currenthedge); } localiter++; }while (currenthedge != basehedge); setprimattrib(0, "found", hedge_prim(0, basehedge), 1); return newhedges; } Since wrangles would produce race conditions in the numbering of found points, I'm running this in a detail wrangle, in a manual loop over an array of half edges. foundprims and foundpts are passed by reference and used in place of setting component attributes, and both are saved to and loaded from detail attributes between iterations. When running this function on a grid of 500 points, I get the following performance: On iteration 7: On iteration 8: A slowdown of roughly %8000 . The size of the arrays are not changing across iterations, as far as I can tell nothing is changing other than their content. If anyone has any idea what I'm doing wrong, I will be extremely grateful. Thanks Quote Link to comment Share on other sites More sharing options...
EdArt Posted November 30, 2021 Author Share Posted November 30, 2021 Restarting houdini fixed it... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.