Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 2fe96174012fea2d88f752857a5bea1d > files > 75

python-mpi4py-0.6.0-4mdv2008.1.i586.rpm

#! /usr/bin/env python

from mpi4py import MPI
import sys

child = MPI.COMM_WORLD.Spawn(sys.executable, ['child.py'],
                             MPI.COMM_WORLD.size+1, MPI.INFO_NULL, root=0)
assert child != MPI.COMM_NULL

print 'parent size: %d, child size: %d' %(child.size, child.remote_size)

if child.rank == 0:
    child.Send('ack', 0)

child.Disconnect()
assert child == MPI.COMM_NULL