카테고리 없음 2023. 3. 3. 03:20

Required programs:

1. Install openmpi on ubuntu 20.04: https://installati.one/install-openmpi-bin-ubuntu-20-04/

2. install C++ compiler: https://linuxconfig.org/how-to-install-g-the-c-compiler-on-ubuntu-20-04-lts-focal-fossa-linux

3. install miniconda3: https://docs.conda.io/en/latest/miniconda.html

4. install mpi4py: 

------------

Activate conda env (use abm-simul-py39.yml for cloning the environment)

  • may need to install openmpi (do it only when having error)
    • conda install -c conda-forge openmpi

Compiling / running mpi program - Find mpi programs for testing in /home/kimsooil/mpi-test/

  • cd /home/kimsoil/mpi-test/
  • conda activate abm-simul-py39
  • (mpicc -o mpi mpi-hello.c) - optional. Do it on your folder.
  • mpirun -np 256 --host localhost:256 mpi
  • (mpic++ mpi-prime.cpp -o mpi-prime) - optional
  • mpirun -np 256 --host localhost:256 ./mpi-prime 1000000
  • python -c "from mpi4py import MPI" - testing if mpi4py is installed properly
  • mpirun -np 256 --host localhost:256 python mpi4py-test.py
posted by kimsooil
: