提交 a0748414 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

add test fn for _test_mpi_roundtrip.py file

I'm currently using os.popen. I tried using subprocess.Popen without success. Would appreciate tips.
上级 0a4fdbcb
from theano.tensor.io import send, recv from theano.tensor.io import send, recv
import theano import theano
import subprocess
import os
def test_recv(): def test_recv():
x = recv((10,10), 'float64', 0, 11) x = recv((10,10), 'float64', 0, 11)
...@@ -21,3 +23,14 @@ def test_can_make_function(): ...@@ -21,3 +23,14 @@ def test_can_make_function():
x = recv((5,5), 'float32', 0, 11) x = recv((5,5), 'float32', 0, 11)
y = x+1 y = x+1
assert theano.function([], [y]) assert theano.function([], [y])
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"
result = os.popen("mpiexec -np 2 python "
"theano/tensor/tests/_test_mpi_roundtrip.py").read()
assert result == "True"
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论