mpi4py.MPI.Win.Rget() NotImplementedError

Issue #106 closed
Jonas Falkner created an issue

Hello,

I am experimenting a bit with parallelization of a complex structure and therefore want to use the RMA Rget() method to get a request object to check and wait for completion of some large get calls. However when I run the code I get an NotImplementedError for the method. But its there and implemented here: https://bitbucket.org/mpi4py/mpi4py/src/master/src/mpi4py/MPI/Win.pyx am I right? So why am I getting that error?

Here some example code:

import numpy as np
from mpi4py import MPI


comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
status = MPI.Status()


dim = 10
itemsize = MPI.DOUBLE.Get_size()
nbytes = dim*itemsize

if rank == 0:
    memory = MPI.Alloc_mem(nbytes + 100)
    memory = np.arange(dim).astype(np.float64)
    print(memory)
    #memory2 = MPI.Alloc_mem(nbytes + 100)
    #memory2 = -np.arange(dim).astype(np.float64)

    fwin = MPI.Win.Create(memory, 1, comm=comm)

else:
    cfwin = MPI.Win.Create(None, comm=comm)

    rbuf = np.zeros(dim, dtype=np.float64)
    print(rank, rbuf)

    print(rank, 'start get...')
    cfwin.Lock(0, lock_type=235)    # MPI_LOCK_SHARED = 235
    #cfwin.Get(rbuf, target_rank=0)
    req = cfwin.Rget(rbuf, target_rank=0)
    cfwin.Unlock(0, )

    req.Wait()

    print(rank, 'get complete.')
    print(rank, rbuf)

run mpirun -np 3 python test_MPI_osc.py and I get the error: [0. 1. 2. 3. 4. 5. 6. 7. 8. 9.] 1 [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] 1 start get... 2 [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] 2 start get... Traceback (most recent call last): File "test_MPI_osc.py", line 33, in <module> req = cfwin.Rget(rbuf, target_rank=0) File "mpi4py/MPI/Win.pyx", line 446, in mpi4py.MPI.Win.Rget NotImplementedError Traceback (most recent call last): File "test_MPI_osc.py", line 33, in <module> req = cfwin.Rget(rbuf, target_rank=0) File "mpi4py/MPI/Win.pyx", line 446, in mpi4py.MPI.Win.Rget NotImplementedError

using mpi4py version 3.0.1a0, but had the same problem with the pip install version 3.0.0, OS is Ubuntu 18.04.1 LTS

Any ideas?

edit: P.S. Does Win.Unlock() already assure the completion of a standard Get() call?

Comments (5)

  1. Lisandro Dalcin

    What MPI implementation and version are you using? If the backend MPI does not support the MPI-3 routines, then mpi4py will still build and install and work. But if you ever using something that requires MPI-3, then you will get the NotImplementedError exception. So, in mpi4py, NotImplementedError means that some required feature is not available (or maybe it was not correctly detected to be available at build time) in the backend MPI implementation.

  2. Lisandro Dalcin

    @mojomotte Any update on your issue? Where you effectively using an MPI implementation without support for the Win operation you are trying to use?

  3. Jonas Falkner reporter

    Hey, sorry for the wait. Yes, basically I had only MPI-2 backend available, what explains the issues. So this issue can be marked as solved. Thanks a lot!

  4. Log in to comment