from mpi4py import MPI import helloworld as hw comm = MPI.COMM_WORLD fcomm = comm.py2f() hw.sayhello(fcomm)
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL hw.sayhello(null) comm = MPI.COMM_WORLD hw.sayhello(comm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
def get_hello(): return helloworld.sayhello()
from mpi4py import MPI import helloworld helloworld.sayhello(MPI.COMM_WORLD) # Hello, World! I am process 0 of 1.
# test.py from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL fnull = null.py2f() hw.sayhello(fnull) comm = MPI.COMM_WORLD fcomm = comm.py2f() hw.sayhello(fcomm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
from mpi4py import MPI import helloworld as hw comm = MPI.COMM_WORLD hw.sayhello(comm)
from mpi4py import MPI import helloworld as hw null = MPI.COMM_NULL fnull = null.py2f() hw.sayhello(fnull) comm = MPI.COMM_WORLD fcomm = comm.py2f() hw.sayhello(fcomm) try: hw.sayhello(list()) except: pass else: assert 0, "exception not raised"
from mpi4py import MPI import helloworld as hw import theano.gof.compilelock theano.gof.compilelock.set_lock_status(False) comm = MPI.COMM_WORLD rank = comm.rank size = comm.size import theano.sandbox.cuda theano.sandbox.cuda.use('gpu{}'.format(rank)) import theano import numpy as np rng = np.random.RandomState(16962 + rank) vec = rng.rand(1000, 1) shared_vec = theano.shared(np.asarray(vec, theano.config.floatX)) hw.sayhello(comm, shared_vec)