Beispiel #1
0
from mpi4py import MPI
import helloworld as hw

comm = MPI.COMM_WORLD
fcomm = comm.py2f()
hw.sayhello(fcomm)
Beispiel #2
0
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"
Beispiel #3
0
def get_hello():
    return helloworld.sayhello()
Beispiel #4
0
from mpi4py import MPI
import helloworld

helloworld.sayhello(MPI.COMM_WORLD)
# Hello, World! I am process 0 of 1.
Beispiel #5
0
# 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"
Beispiel #6
0
from mpi4py import MPI
import helloworld as hw

comm = MPI.COMM_WORLD
hw.sayhello(comm)
Beispiel #7
0
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"
Beispiel #8
0
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)