[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -6,7 +6,8 @@
# Test all_gather() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def all_gather_test(comm, generator, kind):
@@ -15,7 +16,7 @@ def all_gather_test(comm, generator, kind):
result = mpi.all_gather(comm, my_value)
for p in range(0, comm.size):
assert result[p] == generator(p)
if comm.rank == 0: print "OK."
if comm.rank == 0: print( "OK.")
return

View File

@@ -6,7 +6,8 @@
# Test all_reduce() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def all_reduce_test(comm, generator, kind, op, op_kind):
@@ -20,7 +21,7 @@ def all_reduce_test(comm, generator, kind, op, op_kind):
assert result == expected_result
if comm.rank == 0:
print "OK."
print ("OK.")
return
all_reduce_test(mpi.world, int_generator, "integers", lambda x,y:x + y, "sum")

View File

@@ -6,7 +6,8 @@
# Test all_to_all() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def all_to_all_test(comm, generator, kind):
@@ -21,7 +22,7 @@ def all_to_all_test(comm, generator, kind):
for p in range(0, comm.size):
assert result[p] == generator(comm.rank)
if comm.rank == 0: print "OK."
if comm.rank == 0: print ("OK.")
return
all_to_all_test(mpi.world, int_generator, "integers")

23
libs/mpi/test/python/broadcast_test.py Normal file → Executable file
View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python
# Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
# Use, modification and distribution is subject to the Boost Software
@@ -6,24 +7,26 @@
# Test broadcast() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
def broadcast_test(comm, value, kind, root):
if comm.rank == root:
if comm.rank == 0:
print ("Broadcasting %s from root %d..." % (kind, root)),
got_value = None
got_value = mpi.broadcast(comm, value, root)
assert got_value == value
if comm.rank == root:
print "OK."
if comm.rank == 0:
print ("OK.")
return
broadcast_test(mpi.world, 17, 'integer', 0)
broadcast_test(mpi.world, 17, 'integer', 1)
broadcast_test(mpi.world, 'Hello, World!', 'string', 0)
broadcast_test(mpi.world, 'Hello, World!', 'string', 1)
broadcast_test(mpi.world, ['Hello', 'MPI', 'Python', 'World'],
'list of strings', 0)
broadcast_test(mpi.world, ['Hello', 'MPI', 'Python', 'World'],
'list of strings', 1)
if mpi.world.size > 1:
broadcast_test(mpi.world, 17, 'integer', 1)
broadcast_test(mpi.world, 'Hello, World!', 'string', 1)
broadcast_test(mpi.world, ['Hello', 'MPI', 'Python', 'World'],
'list of strings', 1)

View File

@@ -6,7 +6,8 @@
# Test gather() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def gather_test(comm, generator, kind, root):
@@ -17,7 +18,7 @@ def gather_test(comm, generator, kind, root):
if comm.rank == root:
for p in range(0, comm.size):
assert result[p] == generator(p)
print "OK."
print ("OK.")
else:
assert result == None
return

View File

@@ -7,10 +7,8 @@
#
# Authors: Andreas Kloeckner
import boost.mpi as mpi
from __future__ import print_function
import mpi
import random
import sys
@@ -52,7 +50,7 @@ class TagGroupListener:
def rank0():
sent_histories = (mpi.size-1)*15
print "sending %d packets on their way" % sent_histories
print ("sending %d packets on their way" % sent_histories)
send_reqs = mpi.RequestList()
for i in range(sent_histories):
dest = random.randrange(1, mpi.size)
@@ -77,25 +75,25 @@ def rank0():
status, data = tgl.wait()
if status.tag == TAG_DATA:
#print "received completed history %s from %d" % (data, status.source)
#print ("received completed history %s from %d" % (data, status.source))
completed_histories.append(data)
if len(completed_histories) == sent_histories:
print "all histories received, exiting"
print ("all histories received, exiting")
for rank in range(1, mpi.size):
mpi.world.send(rank, TAG_TERMINATE, None)
elif status.tag == TAG_PROGRESS_REPORT:
progress_reports[len(data)] = progress_reports.get(len(data), 0) + 1
elif status.tag == TAG_DEBUG:
print "[DBG %d] %s" % (status.source, data)
print ("[DBG %d] %s" % (status.source, data))
elif status.tag == TAG_TERMINATE:
dead_kids.append(status.source)
else:
print "unexpected tag %d from %d" % (status.tag, status.source)
print ("unexpected tag %d from %d" % (status.tag, status.source))
if is_complete():
break
print "OK"
print ("OK")
def comm_rank():
while True:
@@ -113,7 +111,7 @@ def comm_rank():
mpi.world.send(0, TAG_TERMINATE, 0)
break
else:
print "[DIRECTDBG %d] unexpected tag %d from %d" % (mpi.rank, status.tag, status.source)
print ("[DIRECTDBG %d] unexpected tag %d from %d" % (mpi.rank, status.tag, status.source))
def main():

View File

@@ -6,7 +6,8 @@
# Test reduce() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def reduce_test(comm, generator, kind, op, op_kind, root):
@@ -19,7 +20,7 @@ def reduce_test(comm, generator, kind, op, op_kind, root):
for p in range(1, comm.size):
expected_result = op(expected_result, generator(p))
assert result == expected_result
print "OK."
print ("OK.")
else:
assert result == None
return

View File

@@ -6,7 +6,8 @@
# Test basic communication.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
def ring_test(comm, value, kind, root):
next_peer = (comm.rank + 1) % comm.size;
@@ -27,11 +28,11 @@ def ring_test(comm, value, kind, root):
comm.barrier()
if comm.rank == root:
print "OK"
print ("OK")
pass
if mpi.world.size < 2:
print "ERROR: ring_test.py must be executed with more than one process"
print ("ERROR: ring_test.py must be executed with more than one process")
mpi.world.abort(-1);
ring_test(mpi.world, 17, 'integers', 0)

View File

@@ -6,7 +6,8 @@
# Test scan() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def scan_test(comm, generator, kind, op, op_kind):
@@ -20,7 +21,7 @@ def scan_test(comm, generator, kind, op, op_kind):
assert result == expected_result
if comm.rank == 0:
print "OK."
print ("OK.")
return
scan_test(mpi.world, int_generator, "integers", lambda x,y:x + y, "sum")

View File

@@ -6,7 +6,8 @@
# Test scatter() collective.
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
from generators import *
def scatter_test(comm, generator, kind, root):
@@ -23,7 +24,7 @@ def scatter_test(comm, generator, kind, root):
assert result == generator(comm.rank)
if comm.rank == root: print "OK."
if comm.rank == root: print ("OK.")
return
scatter_test(mpi.world, int_generator, "integers", 0)

View File

@@ -6,7 +6,8 @@
# Test skeleton/content
import boost.parallel.mpi as mpi
from __future__ import print_function
import mpi
import skeleton_content
def test_skeleton_and_content(comm, root, manual_broadcast = True):
@@ -25,7 +26,7 @@ def test_skeleton_and_content(comm, root, manual_broadcast = True):
for p in range(0,comm.size):
if p != comm.rank:
comm.send(p, 0, value = mpi.skeleton(original_list))
print "OK."
print ("OK.")
# Broadcast content
print ("Broadcasting integer list content from root %d..." % (root)),
@@ -34,7 +35,7 @@ def test_skeleton_and_content(comm, root, manual_broadcast = True):
if p != comm.rank:
comm.send(p, 0, value = mpi.get_content(original_list))
print "OK."
print ("OK.")
# Broadcast reversed content
original_list.reverse()
@@ -44,7 +45,7 @@ def test_skeleton_and_content(comm, root, manual_broadcast = True):
if p != comm.rank:
comm.send(p, 0, value = mpi.get_content(original_list))
print "OK."
print ("OK.")
else:
# Allocate some useless data, to try to get the addresses of
# the underlying lists used later to be different across