Compatibility with mpi4py <= 1.3.1.
This commit is contained in:
parent
8d87184330
commit
1892b77a46
3 changed files with 13 additions and 1 deletions
10
python/libsharp/libsharp_mpi.pyx
Normal file
10
python/libsharp/libsharp_mpi.pyx
Normal file
|
@ -0,0 +1,10 @@
|
|||
from mpi4py.MPI cimport Comm
|
||||
cdef extern from "Python.h":
|
||||
object PyLong_FromVoidPtr(void*)
|
||||
|
||||
# For compatibility with mpi4py <= 1.3.1
|
||||
# Newer versions could use the MPI._addressof function
|
||||
def _addressof(comm):
|
||||
cdef void *ptr = NULL
|
||||
ptr = <void*>&(<Comm>comm).ob_mpi
|
||||
return PyLong_FromVoidPtr(ptr)
|
Loading…
Add table
Add a link
Reference in a new issue