Friday, February 6, 2015

MPI4Py

"This package provides Python bindings for the Message Passing Interface (MPI) standard. It is implemented on top of the MPI-1/2/3 specification and exposes an API which grounds on the standard MPI-2 C++ bindings."

Cray

Switch to the GNU environment

$ module switch PrgEnv-cray PrgEnv-gnu

Compile and install MPI4Py

$ cd $WORK/setup
$ wget https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-1.3.1.tar.gz -O mpi4py-1.3.1.tar.gz
$ tar zxf mpi4py-1.3.1.tar.gz
$ cd mpi4py-1.3.1
$ cat >> mpi.cfg <<EOF
[cray]
mpicc = cc
mpicxx = CC
extra_link_args = -shared
EOF
$ python setup.py build --mpi=cray
$ python setup.py install


Make an interactive job for testing.

$ qsub -I -N MPI4Py -q TINY -l select=2:ncpus=24

Wait a minute to get into the parallel environment.

$ module switch PrgEnv-cray PrgEnv-gnu
$ cd $WORK/setup/mpi4py-1.3.1
$ aprun -n 8 -N 4 python demo/helloworld.py


Have fun!