Skip to main content

MPI Basics


Installation

OpenMPI

sudo apt-get install flex
git clone --branch=v4.1.2 --depth=1 https://github.com/open-mpi/ompi.git \
&& cd ompi
./autogen.pl
sudo mkdir -p /opt/openmpi-4.1.2
mkdir build && cd build \
&& ../configure --prefix=/opt/openmpi-4.1.2
make -j$(expr $(expr $(nproc) \* 6) \/ 5) \
&& sudo make install
.zshrc
export PATH=/opt/openmpi-4.1.2/bin:$PATH
export LD_LIBRARY_PATH=/opt/openmpi-4.1.2/lib:$LD_LIBRARY_PATH

MPI4PY

env SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pip install mpi4py
mpiexec -n 5 python -m mpi4py.bench helloworld
info

You have to use methods with all-lowercase names.

MPI.COMM_WORLD.<method>를 사용할 때, method는 소문자인 것을 사용하시기 바랍니다.

Reference