1# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. 2 3# Use, modification and distribution is subject to the Boost Software 4# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5# http://www.boost.org/LICENSE_1_0.txt) 6 7import boost.parallel.mpi as mpi 8 9if mpi.world.rank == 0: 10 mpi.world.send(1, 0, 'Hello') 11 msg = mpi.world.recv(1, 1) 12 print msg,'!' 13else: 14 msg = mpi.world.recv(0, 0) 15 print msg,', ', 16 mpi.world.send(0, 1, 'world') 17