Commit 810b1a67 authored by eric pellegrini's avatar eric pellegrini Committed by Remi Perenon

the name server is now correctly shutdowned

the Test fake analysis now does real computation for better modelling
parent 7dbcd4e3
Pipeline #7172 failed with stages
in 27 minutes and 47 seconds
......@@ -140,13 +140,15 @@ class IJob(Configurable):
# Otherwise, start a new one.
except Pyro.errors.NamingError:
subprocess.Popen([sys.executable, '-O', '-c', "import Pyro.naming; Pyro.naming.main([])"], stdout = subprocess.PIPE)
p = subprocess.Popen([sys.executable, '-O', '-c', "import Pyro.naming; Pyro.naming.main([])"], stdout = subprocess.PIPE)
ns = None
while ns is None:
try:
ns = locator.getNS()
except Pyro.errors.NamingError:
pass
return p
@property
def name(self):
......@@ -261,7 +263,7 @@ class IJob(Configurable):
def _run_remote(self):
IJob.set_pyro_server()
self._pyro_process = IJob.set_pyro_server()
import MDANSE.DistributedComputing.MasterSlave as MasterSlave
......@@ -279,14 +281,16 @@ class IJob(Configurable):
_, _, (idx, x) = tasks.retrieveResult("run_step")
self.combine(idx, x)
if self._status is not None:
if self._status.is_stopped():
self._status.cleanup()
return
else:
self._status.update()
if self._status is not None:
if self._status.is_stopped():
self._status.cleanup()
break
else:
self._status.update()
tasks.shutdown()
self._pyro_process.terminate()
_runner = {"monoprocessor" : _run_monoprocessor, "multiprocessor" : _run_multiprocessor, "remote" : _run_remote}
......
......@@ -44,6 +44,8 @@ class Test(IJob):
self.numberOfSteps = self.configuration['n_steps']['value']
self.results = numpy.zeros((5,5),dtype=numpy.int)
self._matrix = numpy.random.uniform(0,10,(8000,8000))
def run_step(self, index):
......@@ -57,7 +59,7 @@ class Test(IJob):
#. atomicMSD (numpy.array): The calculated mean square displacement for atom index
"""
time.sleep(self.configuration['sleep']['value'])
inv = numpy.linalg.inv(self._matrix)
return index, None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment