Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globalValue raises error from mpi4py #491

Closed
guyer opened this issue Apr 27, 2016 · 2 comments
Closed

globalValue raises error from mpi4py #491

guyer opened this issue Apr 27, 2016 · 2 comments
Assignees

Comments

@guyer
Copy link
Member

guyer commented Apr 27, 2016

As reported on the mailing list, calling var.globalValue in parallel rasies

(parallel)N103898:fipy guyer$ mpirun -np 2 python test.py --trilinos
hello from 0 out of 2
hello from 1 out of 2
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    print 'hello from',fp.tools.parallel.procID,'out of',fp.tools.parallel.Nproc,p.globalValue
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    print 'hello from',fp.tools.parallel.procID,'out of',fp.tools.parallel.Nproc,p.globalValue
  File "/Users/guyer/Documents/research/FiPy/fipy/fipy/variables/cellVariable.py", line 162, in globalValue
  File "/Users/guyer/Documents/research/FiPy/fipy/fipy/variables/cellVariable.py", line 162, in globalValue
    self.mesh._globalNonOverlappingCellIDs)
    self.mesh._globalNonOverlappingCellIDs)
  File "/Users/guyer/Documents/research/FiPy/fipy/fipy/variables/meshVariable.py", line 152, in _getGlobalValue
  File "/Users/guyer/Documents/research/FiPy/fipy/fipy/variables/meshVariable.py", line 152, in _getGlobalValue
    globalIDs = numerix.concatenate(self.mesh.communicator.allgather(globalIDs))
  File "/Users/guyer/Documents/research/FiPy/fipy/fipy/tools/comms/mpi4pyCommWrapper.py", line 75, in allgather
    globalIDs = numerix.concatenate(self.mesh.communicator.allgather(globalIDs))
  File "/Users/guyer/Documents/research/FiPy/fipy/fipy/tools/comms/mpi4pyCommWrapper.py", line 75, in allgather
    return self.mpi4py_comm.allgather(sendobj=sendobj, recvobj=recvobj)
  File "MPI/Comm.pyx", line 1288, in mpi4py.MPI.Comm.allgather (src/mpi4py.MPI.c:109141)
    return self.mpi4py_comm.allgather(sendobj=sendobj, recvobj=recvobj)
  File "MPI/Comm.pyx", line 1288, in mpi4py.MPI.Comm.allgather (src/mpi4py.MPI.c:109141)
TypeError: allgather() got an unexpected keyword argument 'recvobj'
TypeError: allgather() got an unexpected keyword argument 'recvobj'

The recvobj argument was removed in May 2014 and we apparently never noticed. It looks like we can safely delete it from our code as it was apparently never used for anything.

@tkphd
Copy link
Contributor

tkphd commented Apr 27, 2016

The mpi4py commit mentions that the receive object is no longer needed for the lower-case form of the commands. Browsing the full source shows that the upper-case commands retain both the send and receive objects. To avoid deviating too far from the MPI standard, I'd like to suggest changing the case (Allgather instead of allgather), rather than dropping buffers, in our mpi4pyCommWrapper.py.

@tkphd tkphd self-assigned this Apr 28, 2016
@tkphd
Copy link
Contributor

tkphd commented Apr 28, 2016

Looking into the rest of the FiPy source, we're already calling allgather(sendobj) in several places, and only calling allgather(sendobj, recvobj) in mpi4pyCommWrapper.py. To preserve the existing function calls (all of which are lower-case), removing the recvobj argument appears to be the right call after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants