"Single" flag on scheduler does not work

   1830   7   3
User Avatar
Member
295 posts
Joined: April 2017
Offline
Using Houdini 17.5.293 on Windows 10.

I have about a dozen workitems in a TOP network, and I'm trying to troubleshoot some unexpected failures, so I wanted to execute just one workitem at a time. The “single” parameter on the localscheduler seems like it would be the right option to use, but all of the workitems are still processing simultaneously. Likewise, I tried the “Single” parameter in the TOP's scheduler overrides section, and it does nothing. Does this flag actually work? Am I misinterpreting how it's supposed to operate?
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
That should work - I can't reproduce the problem here. The only caveat is that if only one node has the single flag, that mode will only be active as long as that node is executing items.

Can you try it on a simple graph with just a generaticgenerator and see if it works in that case?
User Avatar
Member
295 posts
Joined: April 2017
Offline
Yeah, it just executes everything simultaneously. Attaching my file… maybe I'm using this wrong, but I'd have thought that the workitems should execute sequentially if that flag is enabled.

Attachments:
pdg_single_test.hip (78.3 KB)

MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
Thanks, the single flag only applies to work items that are actually scheduled with the local scheduler (as separate processes). You are using an in-process pythonscript node which is handled by the PDG internal scheduling. There's an existing RFE to expose some control over that internal scheduler, I will add this ‘single’ mode to that RFE.

In the meantime a workaround for you is to put the node inside a For-Loop and toggle Iterations from Upstream Items - this will force sequential execution of the items.
Edited by chrisgreb - Aug. 14, 2019 09:25:19
User Avatar
Member
295 posts
Joined: April 2017
Offline
Thanks Chris!

Is there a detailed explanation somewhere that describes the difference between PDG internal scheduling and the local scheduler? I'll admit I had no idea that there was a distinction between the two.
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
User Avatar
Member
15 posts
Joined: Sept. 2014
Offline
Are there any updates about the progress or the priority of this RFE?
I have multiple in-process python scripts nodes in my setup, which should not be executed simultaneously. The for loop solution doesn't work in this case.
Richard Frangenberg
Founder and developer
https://prism-pipeline.com [prism-pipeline.com]
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
Rico571
Are there any updates about the progress or the priority of this RFE?
I have multiple in-process python scripts nodes in my setup, which should not be executed simultaneously. The for loop solution doesn't work in this case.

No progress - it's still on the RFE list.

If they're all in-process another standard workaround is to use a global lock to ensure only one script executes the critical section.

For example you can use a single upstream python script work item to create the lock and set it on a module object like:
import threading
threading.__mylock = threading.Lock()

then each of your parallel scripts can do their work protected by it:

import threading
with threading.__mylock:
    print ("HI from " + str(`@pdg_index`))
User Avatar
Member
15 posts
Joined: Sept. 2014
Offline
Thanks Chris, that works perfectly.
Richard Frangenberg
Founder and developer
https://prism-pipeline.com [prism-pipeline.com]
  • Quick Links