working slave/master setup
This commit is contained in:
parent
eefcc682cc
commit
f125a653b1
@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import interp.bootstrap
|
|
||||||
from multiprocessing.managers import BaseManager
|
|
||||||
|
|
||||||
from interp.grid.gmsh import gmsh_grid3D
|
|
||||||
|
|
||||||
class QueueManager(BaseManager): pass
|
|
||||||
QueueManager.register('get_inqueue' )
|
|
||||||
QueueManager.register('get_outqueue')
|
|
||||||
|
|
||||||
m = QueueManager(address=('install', 50000), authkey='asdf')
|
|
||||||
m.connect()
|
|
||||||
|
|
||||||
inq = m.get_inqueue()
|
|
||||||
outq = m.get_outqueue()
|
|
||||||
|
|
||||||
while True:
|
|
||||||
for i in xrange(1000):
|
|
||||||
X = np.random.random((1,3))[0]
|
|
||||||
utq.get()
|
|
@ -4,6 +4,8 @@ import sys
|
|||||||
|
|
||||||
from multiprocessing.managers import BaseManager
|
from multiprocessing.managers import BaseManager
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
import interp.bootstrap
|
import interp.bootstrap
|
||||||
from interp.grid.gmsh import gmsh_grid3D
|
from interp.grid.gmsh import gmsh_grid3D
|
||||||
from interp.tools import exact
|
from interp.tools import exact
|
||||||
@ -24,8 +26,11 @@ if __name__ == '__main__':
|
|||||||
outq = m.get_outqueue()
|
outq = m.get_outqueue()
|
||||||
|
|
||||||
g = gmsh_grid3D(sys.argv[1])
|
g = gmsh_grid3D(sys.argv[1])
|
||||||
|
g.q = np.array([exact(x) for x in g.verts])
|
||||||
|
|
||||||
my_name = sys.argv[2]
|
my_name = sys.argv[2]
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
i, X = inq.get()
|
i, X = inq.get()
|
||||||
|
a = g.run_baker(X, order = 3, extra_points = 32)
|
||||||
outq.put((i, my_name, exact(X)))
|
outq.put((i, my_name, exact(X)))
|
||||||
|
Loading…
Reference in New Issue
Block a user