python - MPI.Op and performing operation -
i'd use mpi.op class perform operation represented instance of (in case mpi.sum).
here snippet:
input = numpy.array(3, dtype='i') output = numpy.array(3, dtype='i') mpi.sum.reduce_local(input, output) but when try run traceback:
traceback (most recent call last): file "./mpi.py", line 37, in <module> mpi.sum.reduce_local(input, output) file "op.pyx", line 75, in mpi4py.mpi.op.reduce_local (src/mpi4py.mpi.c:54825) attributeerror: 'mpi4py.mpi.op' object has no attribute 'scount' i'm new python it's pretty possible i'm making kind of easy mistake. thoughts?
i'm using python 2.6.6.
okay, have answer question.
it seems bug in mpi4py library fixed: https://bitbucket.org/mpi4py/mpi4py/commits/43c7388ad740e90cc7074c1c21857c3fd3880190
but if don't have newest version of mpi4py can still this:
buffers = [[1,1],[2,2]] result = reduce(mpi.sum, buffers) and result be: [3,3]
Comments
Post a Comment