๋ณ๋ ฌ์ฐ์ฐ์ ๋ํ์ ๊ธฐ์ ์ธ MPI(Message Passing Interface) ๊ธฐ๋ฐ์ ์คํ์์ค ํ๋ก์ ํธ์ธ OpenMPI ์ค์นํ๋ ๋ฐฉ๋ฒ์ ์์๋ณด๊ฒ ์ต๋๋ค.
์ค์น ํ๊ฒฝ์ ์ฐ๋ถํฌ LTS(Long Term Support) ๋ฒ์ ์ ์ต์ ๋ฒ์ ์ธ 20.04์์ ์ค์นํ์์ต๋๋ค.
์ค์น ๋ฐฉ๋ฒ
1. OpenMPI ํ์ผ์ ๋ค์ด๋ก๋
https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.1.tar.gz
2. ๋ค์ด๋ก๋ ๋ฐ์ ํ์ผ ์์ถ ํด์
tar -xvf openmpi-4.1.1.tar.gz
3. ์์ถ ํด์ ํ ํด๋๋ก ์ด๋ํ์ฌ ํ๊ฒฝ ์ค์
cd openmpi-4.1.1 ./configure --prefix=/usr/local
์ฌ๊ธฐ๊น์ง ์๋ฃ ๋๋ฉด ๊ธด output ๋ฉ์์ง๊ฐ ์ถ๋ ฅ๋๋ฉฐ, ์๋์ ๊ฐ์ ๋ฉ์์ง๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
Open MPI configuration:
-----------------------
Version: 4.1.1
Build MPI C bindings: yes
Build MPI C++ bindings (deprecated): no
Build MPI Fortran bindings: mpif.h, use mpi, use mpi_f08
MPI Build Java bindings (experimental): no
Build Open SHMEM support: false (no spml)
Debug build: no
Platform file: (none)
Miscellaneous
-----------------------
CUDA support: no
HWLOC support: internal
Libevent support: internal
PMIx support: Internal
Transports
-----------------------
Cisco usNIC: no
Cray uGNI (Gemini/Aries): no
Intel Omnipath (PSM2): no
Intel TrueScale (PSM): no
Mellanox MXM: no
Open UCX: no
OpenFabrics OFI Libfabric: no
OpenFabrics Verbs: no
Portals4: no
Shared memory/copy in+copy out: yes
Shared memory/Linux CMA: yes
Shared memory/Linux KNEM: no
Shared memory/XPMEM: no
TCP: yes
Resource Managers
-----------------------
Cray Alps: no
Grid Engine: no
LSF: no
Moab: no
Slurm: yes
ssh/rsh: yes
Torque: no
OMPIO File Systems
-----------------------
DDN Infinite Memory Engine: no
Generic Unix FS: yes
IBM Spectrum Scale/GPFS: no
Lustre: no
PVFS2/OrangeFS: no
4. OpenMPI ์ค์น
sudo make all install
์์ ๊ฐ์ด ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ๋ฉด ์ค์ ๋ ํ๊ฒฝ ์ค์ ์ ๋ฐ๋ผ OpenMPI๊ฐ ์ค์น๋ฉ๋๋ค. ์ค์น ๊ณผ์ ์์ ์๋์ ๊ฐ์ ๋ฉ์์ง๊ฐ ๋ํ๋๋ฉด ์ ์ค์น๊ฐ ๋๊ณ ์๋ ๊ฒ์ ๋๋ค.
Libraries have been installed in:
/usr/local/lib/openmpi
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
์ค์น ํ์ธ ๋ฐฉ๋ฒ
์ค์น๊ฐ ์๋ฃ๋๋ฉด
mpirun
๋ช ๋ น์ด๋ก ์ค์น๊ฐ ์๋์๋์ง ํ์ธ์ด ๊ฐ๋ฅํฉ๋๋ค. ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฒฝ๋ก ๋ฑ์ด ์ค์ ๋๋ ๊ณผ์ ์ด ์์ด ๋ฐ๋ก ์คํํ๋ฉด ์ข ์ข ์๋ฌ๋ฉ์์ง๋ฅผ ๋ณผ ์๋ ์๋๋ฐ์ ์๋์ ๋ฉ์์ง์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ ์๋ ์์ต๋๋ค.
Error while loading shared libraries: libopen-rte.so.40
์ด ๊ฒฝ์ฐ์๋ ์๋์ ๊ฐ์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ๋ฉด ํด๊ฒฐ ๋ฉ๋๋ค. ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฒฝ๋ก๋ ํ๊ฒฝ ๋ณ์ ๊ด๋ จํ ์ค์ ์ ์๋ก์ด ํด์ฃผ๋ ๋ช ๋ น์ด๊ฐ ๋๊ฒ ์ต๋๋ค.
sudo ldconfig
์ฌ๊ธฐ๊น์ง ํ์ฌ mpirun ๋ช ๋ น์ด๊ฐ ์ ์ ๋์ํ๋ค๋ฉด, openmpi์ค์น๊ฐ ์๋ฃ๋ ๊ฒ์ ๋๋ค. mpirun ์ดํ์ ์ํํ ๋ช ๋ น๋ค์ ์ง์ ํ์ง ์์๊ธฐ ๋๋ฌธ์ ์๋์ ๊ฐ์ด ํ๋ฉด์ด ๋ณด์ด๋ฉด ์ ์์ ๋๋ค.
--------------------------------------------------------------------------
mpirun could not find anything to do.
It is possible that you forgot to specify how many processes to run
via the "-np" argument.
--------------------------------------------------------------------------
์ฐธ๊ณ ์๋ฃ
1. OpenMPI ๋ค์ด๋ก๋ ๊ฒฝ๋ก
https://www.open-mpi.org/software/ompi/v4.1/
2. OpenMPI ๋น๋ ๋ฐฉ๋ฒ
https://www.open-mpi.org/faq/?category=building
๋๊ธ