From: aguerre Date: Mon, 13 Jan 2014 13:01:58 +0000 (+0000) Subject: If concurrent execution mode OFF X-Git-Tag: V7_main_EDF_patch_concurrent_140113~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a51118504d24988eeef6877eccf9e69ade9410f;p=modules%2Fkernel.git If concurrent execution mode OFF --- diff --git a/bin/salomeRunner.py b/bin/salomeRunner.py index b96322063..aa1dee6ca 100644 --- a/bin/salomeRunner.py +++ b/bin/salomeRunner.py @@ -267,11 +267,11 @@ class SalomeRunner: def _killAll(self, args=[]): absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','') try: - import PortManager - ports = PortManager.getBusyPorts() - + import PortManager # mandatory from multiprocessing import Process from killSalomeWithPort import killMyPort + ports = PortManager.getBusyPorts() + if ports: import tempfile for port in ports: @@ -279,13 +279,15 @@ class SalomeRunner: p = Process(target = killMyPort, args=(port,)) p.start() p.join() + + p = Process(target = killMyPort, args=(2809,)) + p.start() + p.join() except ImportError: + from killSalome import killAllPorts + killAllPorts() pass - p = Process(target = killMyPort, args=(2809,)) - p.start() - p.join() - # def _showInfo(self, args=[]): diff --git a/bin/searchFreePort.py b/bin/searchFreePort.py index 0bcc470b2..712ec257b 100644 --- a/bin/searchFreePort.py +++ b/bin/searchFreePort.py @@ -158,6 +158,7 @@ def searchFreePort(args={}, save_config=1, use_port=None): Returns first found free port number. """ try: + import PortManager # mandatory from multiprocessing import Process, Queue queue = Queue() p = Process(target = searchFreePort_withPortManager, args=(queue, args, save_config, use_port,))