提交 5bb7dd87 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Update MPI test to work with python3

上级 c01626c8
...@@ -33,19 +33,18 @@ def test_can_make_function(): ...@@ -33,19 +33,18 @@ def test_can_make_function():
assert theano.function([], [y]) assert theano.function([], [y])
def test_mpi_roundtrip(): def test_mpi_roundtrip():
# p = subprocess.Popen(executable="mpiexec",
# args = ("-np", "2",
# "python",
# "theano/tensor/tests/_test_mpi_roundtrip.py"),
# stdout=subprocess.PIPE)
# assert p.stdout.read() == "True"
if not mpi_enabled: if not mpi_enabled:
return return
theano_root = theano.__file__.split('__init__')[0] theano_root = theano.__file__.split('__init__')[0]
sin, sout, serr = os.popen3("mpiexec -np 2 python " + theano_root + p = subprocess.Popen("mpiexec -np 2 python " + theano_root +
"tensor/tests/_test_mpi_roundtrip.py") "tensor/tests/_test_mpi_roundtrip.py",
result = sout.read() stdin=subprocess.PIPE,
assert "True" in result stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
close_fds=True)
result = theano.compat.decode(p.stdout.read())
assert "True" in result, theano.compat.decode(p.stderr.read())
def test_mpi_send_wait_cmp(): def test_mpi_send_wait_cmp():
x = theano.tensor.matrix('x') x = theano.tensor.matrix('x')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论