kleer001 Posted May 10, 2013 Share Posted May 10, 2013 Unless I've missed something the Smooth SOP is not multi-threaded. I working on 1 million+ points on a geo in a 200+ frame range with only one Hbatch licence and it's killing me to see the CPU usage pegged at 3% on my 12 core machine How would you go about parallelizing the Smooth SOP? I don't know what's going on under the hood with that process, but I bet a good old point cloud would be useful in there somewhere. I bet someone's already solved this problem too. Quote Link to comment Share on other sites More sharing options...
symek Posted May 10, 2013 Share Posted May 10, 2013 It's not time dependent, so unless RAM limits you, start 12 x hscripts instances on a single computer and off you go! 1 Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted May 10, 2013 Share Posted May 10, 2013 It's not time dependent, so unless RAM limits you, start 12 x hscripts instances on a single computer and off you go! Yes, I've relied on this method a lot and in other applications too. If you need to do this frequently it helps to setup a script for it. This is a quickie I wrote for OS X but should work on any platform if you change the path (or change it so the path is automatic). def multiRop(ropNode, threads): import os import hou hbatchPath = '/Library/Frameworks/Houdini.framework/Versions/12.5.316.22/Resources/bin/hbatch' firstFrame = ropNode.parm('f1').eval() lastFrame = ropNode.parm('f2').eval() scenePath = hou.hipFile.path() for thread in range(0, threads): startFrame = firstFrame + thread os.system('echo "render -V -f %s %s -i %s %s; quit" | %s %s > ~/logForThread_%s.txt &' % (startFrame, lastFrame, threads, ropNode.path(), hbatchPath, scenePath, thread))def kill(): import os os.system('killall hbatch')[/CODE] 2 Quote Link to comment Share on other sites More sharing options...
kleer001 Posted May 10, 2013 Author Share Posted May 10, 2013 It's not time dependent, so unless RAM limits you, start 12 x hscripts instances on a single computer and off you go! Yup, lol, I was just about to edit and say "Except for running a bunch of instancse." Because I'm doing that right now, so it's a valid work around of course, but it seems so inefficent. Quote Link to comment Share on other sites More sharing options...
kleer001 Posted May 10, 2013 Author Share Posted May 10, 2013 Wonderful Illusionist!!! Quote Link to comment Share on other sites More sharing options...
kleer001 Posted May 10, 2013 Author Share Posted May 10, 2013 (edited) Oh, I spoke too soon. Looks like I can't Python hard enough as the sensible looking path: hbatchPath = 'C:\apps64\Side Effects Software\Houdini 12.5.376\bin\hbatch.exe' gets me no love... only the "path could not be found" error. Even though it's the darn path to the program. I tried swappin out the "/" for "\", but same result. I guess it's opening new GUI instances for me. Still, 10 minutes is better than 50. Edited May 10, 2013 by kleer001 Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted May 13, 2013 Share Posted May 13, 2013 Oh, I spoke too soon. Looks like I can't Python hard enough as the sensible looking path: hbatchPath = 'C:\apps64\Side Effects Software\Houdini 12.5.376\bin\hbatch.exe' gets me no love... only the "path could not be found" error. Even though it's the darn path to the program. I tried swappin out the "/" for "\", but same result. I guess it's opening new GUI instances for me. Still, 10 minutes is better than 50. Python on Windows is a little funky, since Python treats the backslash as an escape character you have to double them up. Something like this. 'C:\\Program Files\\whatever\\something.exe'[/CODE]When I get some downtime at work I'll update that to automatically find the current Houdini path which is probably what I should have done in the first place. Quote Link to comment Share on other sites More sharing options...
rdg Posted May 13, 2013 Share Posted May 13, 2013 When I get some downtime at work I'll update that to automatically find the current Houdini path which is probably what I should have done in the first place. Maybe this works on Windows as well: import osos.path.join(os.getenv('HFS'), 'bin', 'hbatch')[/CODE] Quote Link to comment Share on other sites More sharing options...
0rr Posted May 13, 2013 Share Posted May 13, 2013 If you don't need a sophisticated smoothing algorithm you can also try a very simple smoother. Simply calculate the barycenter of all adjacent vertices and set it to the current vertex position. This is not multithreaded but it's a little faster then the default houdini smoother. simpleSmoothing.hip 2 Quote Link to comment Share on other sites More sharing options...
kleer001 Posted May 14, 2013 Author Share Posted May 14, 2013 (edited) What a treat! Oh ho ho! Thank you gentlemen, I really appreciate it! I'll try 'em all out. (I never quite appreciated how much I was relying on the technical support of other houdini artists at bigger studios. Being a lone wolf is hairy to say the least, but it's good.) Edited May 14, 2013 by kleer001 Quote Link to comment Share on other sites More sharing options...
kleer001 Posted June 7, 2013 Author Share Posted June 7, 2013 (edited) Sad news is none of those path string massaging techniques work. I've tried "\\", "/", and the good looking os.path.join technique which gives me 'C:/apps64/SIDEEF~1/HOUDIN~1.376\\bin\\hbatch' Nothing works. Maybe it's some permissions error. I have no idea. This is super frustrating. Edited June 7, 2013 by kleer001 Quote Link to comment Share on other sites More sharing options...
Guest mantragora Posted June 7, 2013 Share Posted June 7, 2013 (edited) Try : hbatch = os.path.normpath(os.path.join(os.getenv('HFS'), 'bin', 'hbatch.exe')) It should fix your mixed slashes. Don't forget to write full file name with extension. Without it, if you test returned path with os.path.isfile(hbatch) it will return False Edited June 7, 2013 by mantragora Quote Link to comment Share on other sites More sharing options...
kleer001 Posted June 11, 2013 Author Share Posted June 11, 2013 Still on Windows 7, still crying myself to sleep. I finally got hbatch to run and I'm still banging away at this (thanks lukeiamyourfather for the code), but it's still resisting my best efforts to get work done: def multiRop(ropNode, threads): import os import hou hbatchPath = os.path.normpath(os.path.join(os.getenv('HFS'), 'bin', 'hbatch.exe')) hbatchPath = "\""+hbatchPath+"\"" firstFrame = ropNode.parm('f1').eval() lastFrame = ropNode.parm('f2').eval() scenePath = hou.hipFile.path() scenePath = "\""+scenePath+"\"" for thread in range(0, threads): startFrame = firstFrame + thread os.system('echo "help; render -V -f %s %s -i %s %s ; quit" | %s %s >C:\\temp\\logForThread_%s.txt && pause' % (startFrame, lastFrame, threads, ropNode.path(), hbatchPath, scenePath, thread))[/CODE]Seems to load up the scene when I input my hip file and valid ROP, but the launched hbatch doesn't seem to recognize the 'render' command. It does however recognize the 'help' command and I get the expected regular output in my log file... However if I put up the encased command above I get "Unknown command: help; render...." What the what what?!And even if this works something tells me it's not going to launch multiple simultaneous instances of hbatch (which is the whole point of the exercise). Right? Quote Link to comment Share on other sites More sharing options...
kleer001 Posted August 27, 2013 Author Share Posted August 27, 2013 Goshdarnit! Nothing I try works. It's really bizarre because the help command works, but hbatch won't accept any commands in a single line launched at once. It only renders if I launch it manually and then wait for the console to come up. I'm still resorting to launching a bunch of Houdini interactive sessions and manually setting their start frames. Quote Link to comment Share on other sites More sharing options...
Artem Smirnov Posted August 28, 2013 Share Posted August 28, 2013 (edited) Hi. I found this problem interesting and tryed to solve it on my own. I came up with kind of solution but it is not very clean. But it works and may give you a hint. Anyway I hope it will help For the attached file to work, your windows "path" environment must be set to ""C:\Program Files\Side Effects Software\Houdini 12.5.(HOUDINI BUILD NUMBER!!!)\bin" (it is needed to run hython without directly defining path in script) Also "start.py" file from attached archive must be moved to the root of C drive. main script is in the python source editor tab in the hip file. You can launch it from python shell by calling: hou.session.threadedRun(ropNode, number of threads) The code is very rough, please ignore this) forOdForce.rar Edited September 9, 2013 by Artem Smirnov 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.