betckegroup / mpi4py_with_rsmpi

Demonstration code for using rsmpi with mpi4py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing an MPI communicator from mpi4py to Rust rsmpi

This small example demonstrates how to pass a communicator from Python to Rust and use it with rsmpi from within Rust.

It is developed so that maturin can automatically generate the correct cffi bindings. To compile just call

maturin develop -b cffi

This compiles the Rust part, generates a pip module and installs the pip module. To execute the code create a small file called say_rank.py which contains

from mpi4py_with_rsmpi import say_rank, COMM

say_rank(COMM)

and call it for example with

mpirun -n 4 python say_rank.py

This will initialize the MPI system within Python. But the rank of each process is printed out from Rust with rsmpi.

About

Demonstration code for using rsmpi with mpi4py

License:MIT License


Languages

Language:Rust 72.9%Language:Python 27.1%