Well, I would say you should try mpi4py. However, mpi4py hgih-level,
object oriented API is targeted to be used from Python and not Cython
(i.e. no cpdef methods at all). However, you can easily extract the
MPI C handles from the Python objects and call any MPI C API
functions, as you can see here:

http://code.google.com/p/mpi4py/source/browse/trunk/demo/cython/helloworld.pyx

This esample is a bit of mess, because it shows many different ways of
doing things... If you want to make fast MPI calls, you will be
interested in the last part.

Note that "from mpi4py.mpi_c cimport *" should also work (instead of
'include mpi4py/mpi.pxi'), though I've not tested that. That example
was written long ago in a time where likely "cimport *" did not work.



On Wed, Apr 8, 2009 at 10:58 AM, Dag Sverre Seljebotn
<[email protected]> wrote:
> What's the best way of using MPI from Cython? Should one use the C library
> directly (has anyone written a pxd?), or is there an MPI wrapper library
> with the same Python and Cyhthon interfaces?
>
> Dag Sverre
>
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to