]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpi/test/python/broadcast_test.py
2 # Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
4 # Use, modification and distribution is subject to the Boost Software
5 # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 # http://www.boost.org/LICENSE_1_0.txt)
8 # Test broadcast() collective.
10 from __future__
import print_function
13 def broadcast_test(comm
, value
, kind
, root
):
15 print ("Broadcasting %s from root %d..." % (kind
, root
)),
17 got_value
= mpi
.broadcast(comm
, value
, root
)
22 broadcast_test(mpi
.world
, 17, 'integer', 0)
23 broadcast_test(mpi
.world
, 'Hello, World!', 'string', 0)
24 broadcast_test(mpi
.world
, ['Hello', 'MPI', 'Python', 'World'],
26 if mpi
.world
.size
> 1:
27 broadcast_test(mpi
.world
, 17, 'integer', 1)
28 broadcast_test(mpi
.world
, 'Hello, World!', 'string', 1)
29 broadcast_test(mpi
.world
, ['Hello', 'MPI', 'Python', 'World'],