๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IT-Engineering/Linux

์šฐ๋ถ„ํˆฌ(Ubuntu) OpenMPI ์„ค์น˜ํ•˜๊ธฐ ๋ฐฉ๋ฒ•

by ๐Ÿงž‍โ™‚๏ธ 2021. 9. 17.
๋ฐ˜์‘ํ˜•

์šฐ๋ถ„ํˆฌ(Ubuntu)์—์„œ OpenMPI ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•

 

๋ณ‘๋ ฌ์—ฐ์‚ฐ์˜ ๋Œ€ํ‘œ์  ๊ธฐ์ˆ ์ธ 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/

 

Open MPI: Version 4.1

Changes in this release: See this page if you are upgrading from a prior major release series of Open MPI. It shows the Big Changes for which end users need to be aware. See the NEWS file for a more fine-grained listing of changes between each release and

www.open-mpi.org

2. OpenMPI ๋นŒ๋“œ ๋ฐฉ๋ฒ•

https://www.open-mpi.org/faq/?category=building 

 

FAQ: Building Open MPI

Table of contents: How do I build Open MPI? Wow — I see a lot of errors during configure. Is that normal? What are the default build options for Open MPI? Open MPI was pre-installed on my machine; should I overwrite it with a new version? Where should I

www.open-mpi.org

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€