Skip to content

Commit

Permalink
Don't use default JobPool
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Nov 28, 2023
1 parent 5adb3c1 commit 8147cbb
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion apps/stats/stats-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def __writeTask( self, script, args ) :
IECore.msg( IECore.Msg.Level.Error, "stats", "Task \"%s\" does not exist" % args["task"].value )
return

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( tempfile.mkdtemp( prefix = "gafferStats" ) )

memory = _Memory.maxRSS()
Expand Down
2 changes: 1 addition & 1 deletion python/GafferArnoldTest/ArnoldRenderTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def testWedge( self ) :
s["fileName"].setValue( self.temporaryDirectory() / "test.gfr" )
s.save()

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() / "testJobDirectory" )
dispatcher["framesMode"].setValue( GafferDispatch.Dispatcher.FramesMode.CurrentFrame )
dispatcher["executeInBackground"].setValue( False )
Expand Down
6 changes: 3 additions & 3 deletions python/GafferArnoldTest/ArnoldTextureBakeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def testManyImages( self ):
# Dispatch the bake
script = Gaffer.ScriptNode()
script.addChild( arnoldTextureBake )
dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() )
dispatcher.dispatch( [ arnoldTextureBake ] )

Expand Down Expand Up @@ -308,7 +308,7 @@ def testTasks( self ):
# Dispatch the bake
script = Gaffer.ScriptNode()
script.addChild( arnoldTextureBake )
dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() )
dispatcher.dispatch( [ arnoldTextureBake ] )

Expand Down Expand Up @@ -452,7 +452,7 @@ def testMerging( self ):
# Dispatch the bake
script = Gaffer.ScriptNode()
script.addChild( arnoldTextureBake )
dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() )
dispatcher.dispatch( [ arnoldTextureBake ] )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferDispatchTest/FrameMaskTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test( self ) :
s["mask"]["preTasks"][0].setInput( s["task"]["task"] )
s["mask"]["mask"].setValue( "1,3,10-15,20-30x2" )

d = GafferDispatch.LocalDispatcher()
d = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
d["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )
d["framesMode"].setValue( d.FramesMode.CustomRange )
d["frameRange"].setValue( "1-50" )
Expand Down
4 changes: 2 additions & 2 deletions python/GafferDispatchTest/LocalDispatcherTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def testNestedDispatchBorrowingOuterJobDirectory( self ) :
s["dispatchTask"]["command"].setValue( inspect.cleandoc(
"""
import GafferDispatch
dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher.dispatch( [ self.parent()["nestedTask"] ] )
"""
) )
Expand Down Expand Up @@ -1053,7 +1053,7 @@ def _shutdownDuringBackgroundDispatch() :

with tempfile.TemporaryDirectory() as jobDirectory :

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( jobDirectory )
dispatcher["executeInBackground"].setValue( True )
dispatcher.dispatch( [ script["command"] ] )
Expand Down
2 changes: 1 addition & 1 deletion python/GafferDispatchTest/SystemCommandTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def testFrameRangeSubstitutions( self ) :
s["n"] = GafferDispatch.SystemCommand()
s["n"]["command"].setValue( "echo 1 > {}".format( ( self.temporaryDirectory() / "systemCommandTest.####.txt" ).as_posix() ) )

d = GafferDispatch.LocalDispatcher()
d = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
d["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )
d["framesMode"].setValue( d.FramesMode.CustomRange )
d["frameRange"].setValue( "1-10" )
Expand Down
2 changes: 1 addition & 1 deletion python/GafferDispatchTest/TaskSwitchTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TaskSwitchTest( GafferTest.TestCase ) :

def __dispatcher( self ) :

result = GafferDispatch.LocalDispatcher()
result = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
result["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )

return result
Expand Down
2 changes: 1 addition & 1 deletion python/GafferDispatchTest/WedgeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WedgeTest( GafferTest.TestCase ) :

def __dispatcher( self, frameRange = None ) :

result = GafferDispatch.LocalDispatcher()
result = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
result["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )

if frameRange is not None :
Expand Down
4 changes: 2 additions & 2 deletions python/GafferImageTest/ImageWriterTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ def testWriteIntermediateFile( self ) :
s["w2"]["fileName"].setValue( self.temporaryDirectory() / "test2.exr" )
s["w2"]["preTasks"][0].setInput( s["w1"]["task"] )

d = GafferDispatch.LocalDispatcher()
d = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
d["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )

with s.context() :
Expand All @@ -1065,7 +1065,7 @@ def testBackgroundDispatch( self ) :
s["w"]["in"].setInput( s["c"]["out"] )
s["w"]["fileName"].setValue( self.temporaryDirectory() / "test.exr" )

d = GafferDispatch.LocalDispatcher()
d = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
d["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )
d["executeInBackground"].setValue( True )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferImageTest/OpenColorIOConfigPlugTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def testConfigAppliesDuringExecution( self ) :
script["writer"]["fileName"].setValue( self.temporaryDirectory() / "test.txt" )
script["writer"]["text"].setValue( "${ocio:config}, ${ocio:stringVar:testA}" )

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() / "testDispatch" )
dispatcher["executeInBackground"].setValue( True )

Expand Down
2 changes: 1 addition & 1 deletion python/GafferSceneTest/InstancerTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def testDispatchAndGIL( self ) :

traverseConnection = Gaffer.Signals.ScopedConnection( GafferSceneTest.connectTraverseSceneToPreDispatchSignal( script["instancer"]["out"] ) )

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() )

with Gaffer.Context() as c :
Expand Down
2 changes: 1 addition & 1 deletion python/GafferSceneTest/RenderPassWedgeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RenderPassWedgeTest( GafferTest.TestCase ) :

def __dispatcher( self, frameRange = None ) :

result = GafferDispatch.LocalDispatcher()
result = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
result["jobsDirectory"].setValue( self.temporaryDirectory() / "jobs" )

if frameRange is not None :
Expand Down
4 changes: 2 additions & 2 deletions python/GafferSceneTest/SceneWriterTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def testFileNameWithArtificalFrameDependency( self ) :
""".format( filePath.as_posix() )
) )

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() )
dispatcher["framesMode"].setValue( dispatcher.FramesMode.CustomRange )
dispatcher["frameRange"].setValue( "1-10" )
Expand All @@ -328,7 +328,7 @@ def testFileNameWithFrameDependency( self ) :
script["writer"]["in"].setInput( script["plane"]["out"] )
script["writer"]["fileName"].setValue( self.temporaryDirectory() / "test.####.scc" )

dispatcher = GafferDispatch.LocalDispatcher()
dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( self.temporaryDirectory() )
dispatcher["framesMode"].setValue( dispatcher.FramesMode.CustomRange )
dispatcher["frameRange"].setValue( "1-10" )
Expand Down

0 comments on commit 8147cbb

Please sign in to comment.