From 8147cbb71e6aec5a548b15f4da97e20c436cb157 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Tue, 28 Nov 2023 15:28:06 +0000 Subject: [PATCH] Don't use default JobPool --- apps/stats/stats-1.py | 2 +- python/GafferArnoldTest/ArnoldRenderTest.py | 2 +- python/GafferArnoldTest/ArnoldTextureBakeTest.py | 6 +++--- python/GafferDispatchTest/FrameMaskTest.py | 2 +- python/GafferDispatchTest/LocalDispatcherTest.py | 4 ++-- python/GafferDispatchTest/SystemCommandTest.py | 2 +- python/GafferDispatchTest/TaskSwitchTest.py | 2 +- python/GafferDispatchTest/WedgeTest.py | 2 +- python/GafferImageTest/ImageWriterTest.py | 4 ++-- python/GafferImageTest/OpenColorIOConfigPlugTest.py | 2 +- python/GafferSceneTest/InstancerTest.py | 2 +- python/GafferSceneTest/RenderPassWedgeTest.py | 2 +- python/GafferSceneTest/SceneWriterTest.py | 4 ++-- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/stats/stats-1.py b/apps/stats/stats-1.py index 0a2fa417476..f85d6f48e56 100644 --- a/apps/stats/stats-1.py +++ b/apps/stats/stats-1.py @@ -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() diff --git a/python/GafferArnoldTest/ArnoldRenderTest.py b/python/GafferArnoldTest/ArnoldRenderTest.py index d4b05aceaf5..c96fd88e5f6 100644 --- a/python/GafferArnoldTest/ArnoldRenderTest.py +++ b/python/GafferArnoldTest/ArnoldRenderTest.py @@ -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 ) diff --git a/python/GafferArnoldTest/ArnoldTextureBakeTest.py b/python/GafferArnoldTest/ArnoldTextureBakeTest.py index c1688f08770..a54b7544632 100644 --- a/python/GafferArnoldTest/ArnoldTextureBakeTest.py +++ b/python/GafferArnoldTest/ArnoldTextureBakeTest.py @@ -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 ] ) @@ -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 ] ) @@ -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 ] ) diff --git a/python/GafferDispatchTest/FrameMaskTest.py b/python/GafferDispatchTest/FrameMaskTest.py index e80e28d7f94..77e361093ad 100644 --- a/python/GafferDispatchTest/FrameMaskTest.py +++ b/python/GafferDispatchTest/FrameMaskTest.py @@ -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" ) diff --git a/python/GafferDispatchTest/LocalDispatcherTest.py b/python/GafferDispatchTest/LocalDispatcherTest.py index 6875b13af18..ad11234665a 100644 --- a/python/GafferDispatchTest/LocalDispatcherTest.py +++ b/python/GafferDispatchTest/LocalDispatcherTest.py @@ -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"] ] ) """ ) ) @@ -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"] ] ) diff --git a/python/GafferDispatchTest/SystemCommandTest.py b/python/GafferDispatchTest/SystemCommandTest.py index 20aef52c3af..ff718696121 100644 --- a/python/GafferDispatchTest/SystemCommandTest.py +++ b/python/GafferDispatchTest/SystemCommandTest.py @@ -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" ) diff --git a/python/GafferDispatchTest/TaskSwitchTest.py b/python/GafferDispatchTest/TaskSwitchTest.py index 680e905e94e..546fb461a28 100644 --- a/python/GafferDispatchTest/TaskSwitchTest.py +++ b/python/GafferDispatchTest/TaskSwitchTest.py @@ -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 diff --git a/python/GafferDispatchTest/WedgeTest.py b/python/GafferDispatchTest/WedgeTest.py index 658029a5889..5e3b1463b59 100644 --- a/python/GafferDispatchTest/WedgeTest.py +++ b/python/GafferDispatchTest/WedgeTest.py @@ -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 : diff --git a/python/GafferImageTest/ImageWriterTest.py b/python/GafferImageTest/ImageWriterTest.py index 74871a6eedf..c6b0cacea20 100644 --- a/python/GafferImageTest/ImageWriterTest.py +++ b/python/GafferImageTest/ImageWriterTest.py @@ -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() : @@ -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 ) diff --git a/python/GafferImageTest/OpenColorIOConfigPlugTest.py b/python/GafferImageTest/OpenColorIOConfigPlugTest.py index 0c85e5fe5d5..727c4de27ae 100644 --- a/python/GafferImageTest/OpenColorIOConfigPlugTest.py +++ b/python/GafferImageTest/OpenColorIOConfigPlugTest.py @@ -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 ) diff --git a/python/GafferSceneTest/InstancerTest.py b/python/GafferSceneTest/InstancerTest.py index f165af2332e..5a205c5afaf 100644 --- a/python/GafferSceneTest/InstancerTest.py +++ b/python/GafferSceneTest/InstancerTest.py @@ -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 : diff --git a/python/GafferSceneTest/RenderPassWedgeTest.py b/python/GafferSceneTest/RenderPassWedgeTest.py index 9867ff1d32b..f5e7b5861b9 100644 --- a/python/GafferSceneTest/RenderPassWedgeTest.py +++ b/python/GafferSceneTest/RenderPassWedgeTest.py @@ -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 : diff --git a/python/GafferSceneTest/SceneWriterTest.py b/python/GafferSceneTest/SceneWriterTest.py index 667ea9aa13d..7f5c0293e20 100644 --- a/python/GafferSceneTest/SceneWriterTest.py +++ b/python/GafferSceneTest/SceneWriterTest.py @@ -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" ) @@ -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" )