[HPC] 리눅스 HPC 기본 설치법
LINUX HPC Clustering Technical Doc
작성일 : 2007년 5월 3일
** 운영체제 기본 초기 데몬 정리 **
# chkconfig –list | grep 3:활성 | awk ‘{print $1}’ > chkdm.sh
# vi chkdm.sh
——————————————————————————–
sshd
irqbalance
xfs
crond
netfs
named
portmap
network
xinetd
syslog
외 나머지 삭제 후 ex 치환으로 아래 실행 ..
%s/^/chkconfig –level 345 /g
%s/$/ off/g
——————————————————————————–
# ./chkdm.sh
1.rsh,rlogin설정
#rpm –qa | grep rsh-server -> rsh-server 설치 확인
# vi /etc/hosts ( 공통 )
——————————————————————————-
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.123.63 xeon01
192.168.123.64 xeon02
——————————————————————————-
# chkconfig –level 345 rsh on
# chkconfig –level 345 rlogin on
# /etc/rc.d/init.d/network restart
# rm -rf /etc/profile.d/krb*
# vi /etc/securetty (터미널 보안관련 설정)
——————————————————————————-
tty7
tty8
.
.
.
rsh
rlogin
——————————————————————————-
# vi /etc/hosts.equiv (일반 사용자)
——————————————————————————-
xeon01
xeon02
..
..
——————————————————————————-
# vi /root/.rhosts (루트 사용자)
——————————————————————————-
xeon01
xeon02
..
..
——————————————————————————-
# chmod 600 /root/.rhosts
2.ensh 설치 및 설정
# rpm -Uvh expect-*
# rpm -Uvh ensh-2.0.2-2.i386.rpm
# cd /engrid/ensh/etc
# vi nodelist
——————————————————————————-
xeon01
xeon02
..
..
——————————————————————————-
# source /etc/profile.d/ensh.sh
# ensh –init
** 참고 **
# cd /engrid/ensh/bin (참고)
3.time sync 설정
– time server 에서 설정 –
# chkconfig time on
– client 설정 –
# rdate -s xeon01
– time server –
# crontab -e
——————————————————————————-
* * * * * rdate -s time.bora.net
01 * * * * timesync
——————————————————————————-
– ensh 를 이용한 클러스터 전체 노드 시간 동기화 –
#timesync
– ensh 를 이용한 클러스터 전체 노드 시간 확인 –
#timeview
4.nfs,nis,automount 설정
– NFS 설정 (홈 디렉토리 공유)
* 서버 설정 *
# vi /etc/exports
——————————————————————————-
/home *(rw,no_root_squash)-> (read,write, 해당디렉토리에 root권한 할당)
——————————————————————————-
# /etc/rc.d/init.d/portmap restart
# /etc/rc.d/init.d/nfs restart
# chkconfig –level 345 portmap on
# chkconfig –level 345 nfs on
* 클라이언트 설정 *
# vi /etc/auto.master
——————————————————————————-
#
# $Id: auto.master,v 1.3 2003/09/29 08:22:35 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#/misc /etc/auto.misc –timeout=60
#/misc /etc/auto.misc
#/net /etc/auto.net
/home /etc/auto.home –timeout=3
~
——————————————————————————-
*** / 디렉토리는 사용할수 없다. ***
# vi /etc/auto.home
——————————————————————————-
* -rw,soft,intr xeon01:/home/&
——————————————————————————-
rw: 파일시스템을 읽기, 쓰기로 마운트
soft: 만약 서버가 다운되면 서버가 그 파일 시스템에 접근하려는 동작을 fail 시키고 에러를 리턴. 이것은 불필요한 마운트에 대해 쓸데없는 프로세서의 생성을 피하는데 >유용
intr: 사용자가 블록된 작업에 대해 인터럽트를 걸어 그 작업들이 풀려서 에러를 돌려주도록 한다.
# /etc/rc.d/init.d/portmap restart
# /etc/rc.d/init.d/autofs restart
# chkconfig –level 345 portmap on
# chkconfig –level 345 autofs on
– NIS 설정 (계정 통합) –
#rpm -Uvh ypbind-x.x.x.rpm
#rpm -Uvh yp-tools-x.x.x.rpm
#rpm -Uvh ypserv-x.x.x.rpm -> (계정 서버일 경우 설치)
# vi /etc/host.conf(공통)
——————————————————————————-
order hosts,bind
multi on
~
——————————————————————————-
NIS 도메인 이름을 결정한다
# nisdomainname cluster.cc(공통)
# vi /etc/sysconfig/networtk(공통)
——————————————————————————-
NETWORKING=yes
HOSTNAME=xeon02
NISDOMAIN=cluster.cc
~
——————————————————————————-
– 서버설정 –
NIS 시스템에서 shadow file 을 인식 할수 있도록 설정변경
# vi /var/yp/Makefile
** shadow 를 추가 **
——————————————————————————-
# If you don’t want some of these maps built, feel free to comment
# them out from this list.
all: passwd group hosts rpc services netid protocols mail shadow \\
# netgrp shadow publickey networks ethers bootparams printcap \\
# amd.home auto.master auto.home auto.local passwd.adjunct \\
# timezone locale netmasks
.
.
passwd: files nisplus nis
shadow: files nisplus nis
group: files nisplus nis
——————————————————————————-
* server *
# adduser king
# passwd king
# make -C /var/yp
——————————————————————————-
* client *
# yptest
——————————————————————————-
Test 9: yp_all
king king:$1$GKtAyY2c$3FFUJIcQvczsPev.xk.rY/:501:501::/home/king:/bin/bash
clunix clunix:!!:500:500::/engrid/clunix:/bin/bash
1 tests failed
——————————————————————————-
# ypcat passwd
——————————————————————————-
king:$1$GKtAyY2c$3FFUJIcQvczsPev.xk.rY/:501:501::/home/king:/bin/bash
clunix:!!:500:500::/engrid/clunix:/bin/bash
——————————————————————————-
*** 모든 파일은 같은 위치에 ***
5.mpich 설치 및 설정
# tar zxvf mpich.tar.gz
# cd mpich-1.2.7p1
# ./configure –prefix=/usr/local/mpich-gcc –with-device=ch_p4 –with-arch=LINUX
# make && make install
# cd /usr/local/mpich-gcc/share
# vi machines.Linux
——————————————————————————–
# Change this file to contain the machines that you want to use
# to run MPI jobs on. The format is one host name per line, with either
# hostname
# or
# hostname:n
# where n is the number of processors in an SMP. The hostname should
# be the same as the result from the command “hostname”
xeon01:4
xeon02:4
———————————————————————————————-
# cd /usr/local/mpich-gcc/examples/
# make
# ./mpirun -np 6 cpi
———————————————————————————————-
Process 0 on xeon02
Process 4 on xeon01
Process 3 on xeon02
Process 2 on xeon01
pi is approximately 3.1416009869231245, Error is 0.0000083333333314
wall clock time = 0.006805
———————————————————————————————-
# vi /etc/profile.d/mpich-gcc.sh
———————————————————————————————-
#/bin/sh
MPICH_HOME=/usr/local/mpich-gcc
PATH=$MPICH_HOME/bin:$PATH
export MPICH_HOME PATH~
———————————————————————————————-
# source /etc/profile.d/mpich-gcc.sh
* 전체 노드 동기화 *
# ensync /etc/profile.d/mpich-gcc.sh
6.intel compiler 설치 및 설정
# tar zxvf l_cc_p_9.0.021.tar.gz
# cd l_cc_p_9.0.021
# ./install.sh
——————————————————————————–***************************”Welcome to Installation”**************************
Please make your selection by entering an option:
1. “Intel(R) C++ Compiler 9.0 for Linux*” – install 1a. Readme
1b. Release Notes
1c. Installation Guide
1d. Product Web Site URL
1e. Intel(R) Support Web Site URL
x. Exit. Please type a selection : 1
——————————————————————————-
======================================================================
Please select an option to continue:
1. Proceed with Serial Number to install and register. [Recommended]
2. Provide name of an existing license file. x. Exit.
Please type your selection : 2
———————————————————————————————-
Please provide the license file name with full path (*.lic)
x.Exit
License file path : /usr/local/src/teragonpkg/intel/noncommercial_cpp_l_N4R8-7SJT89NF.lic
———————————————————————————————-
Which of the following would you like to do?
1. Typical Install (Recommended – Installs All Components).
2. Custom Install (Advanced Users Only).
x. Exit.
Please type a selection: 2
———————————————————————————————-
Which of the following would you like to install?
1. Intel(R) C++ Compiler for 32-bit applications, Version 9.0
2. Linux Application Debugger for 32-bit applications, Version 9.0
3. Plugins/Features for Integration into Eclipse* and Integrate into existing or Install new Eclipse Package.
x. Exit
Please make a selection :
# 1,2번만 선택
———————————————————————————————-
# tar zxvf l_fc_p_9.0.021.tar.gz
# cd l_fc_p_9.0.021
# ./install.sh
———————————————————————————————-
**********************”Welcome to Installation”********************************
Please make your selection by entering an option:
1. “Intel(R) Fortran Compiler 9.0 for Linux*” – install
1a. Readme
1b. Release Notes
1c. Installation Guide
1d. Product Web Site URL 1e. Intel(R) Support Web Site URL
x. Exit.
Please type a selection : 1
———————————————————————————————-
Please select an option to continue: 1. Proceed with Serial Number to install and register. [Recommended]
2. Provide name of an existing license file.
x. Exit.
Please type your selection : 2
———————————————————————————————-
Please provide the license file name with full path (*.lic)
x.Exit
License file path : /usr/local/src/teragonpkg/intel/noncommercial_for_l_NJ24-XT4JNWFL.lic
———————————————————————————————-
Which of the following would you like to do?
1. Typical Install (Recommended – Installs All Components).
2. Custom Install (Advanced Users Only).
x. Exit.
Please type a selection: 1
———————————————————————————————-
# cd /opt/intel/cc/9.0/bin
# cp iccvars.sh /etc/profile.d/
# source /etc/profile.d/iccvarsh.sh
# cd /opt/intel/cc/9.0/doc/samples
# icc -o int_sin int_sin.c
# ./int_sin
——————————————————————————–
# cd /opt/intel/fc/9.0/bin
# cp ifortvars.sh /etc/profile.d/
# source /etc/profile.d/ifortvars.sh
# cd /opt/intel/fc/9.0/doc/samples
# ifort -o int_sin int_sin.f90
# ./int_sin
——————————————————————————–
# 전체 노드 동기화
# ensync /opt/intel
6-1 mpich + intel compiler 환경 구축
* intel compiler 설치 환경 확인
cc : /opt/intel/cc/9.0/bin/icc
fc : /opt/intel/fc/9.0/bin/ifort
c++ : /opt/intel/cc/9.0/bin/icpc
# tar zxvf mpich.tar.gz
# cd mpich-1.2.7p1
#./configure –prefix=/usr/local/mpich-intel -fc=/opt/intel/fc/9.0/bin/ifort \\
-cc=/opt/intel/cc/bin/icc -c++=/opt/intel/cc/9.0/bin/icpc –with-device=ch_p4 \\
–with-arch=LINUX
# make && make install
# cd /usr/local/mpich-intel/share
# vi machines.LINUX
———————————————————————————————-
# Change this file to contain the machines that you want to use
# to run MPI jobs on. The format is one host name per line, with either # hostname # or
# hostname:n
# where n is the number of processors in an SMP. The hostname should
# be the same as the result from the command “hostname”
xeon01:4
xeon02:4
———————————————————————————————-
# cd /usr/local/mpich-intel/examples
# make
# cd /etc/profile.d
# vi mpich-intel.sh
———————————————————————————————-
#/bin/sh
MPICH_HOME=/usr/local/mpich-intel
PATH=$MPICH_HOME/bin:$PATH
export MPICH_HOME PATH
~
———————————————————————————————-
# source /etc/profile.d/mpich-intel
# 전체 노드 동기화 #
—-> ensyc /usr/local/mpich-intel
# cd /usr/local/mpich-intel/examples
# ./mpirun -np 6 cpi
———————————————————————————————-
Process 0 on xeon02
Process 3 on xeon02
Process 5 on xeon02
Process 2 on xeon01
Process 4 on xeon01
pi is approximately 3.1416009869231249, Error is 0.0000083333333318
wall clock time = 0.005525
———————————————————————————————-
7. PGI Compiler 설치 및 설정
# cd pgi615
# ./install
———————————————————————————————-
YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT AND AGREE TO BE BOUND
BY ITS TERMS. YOU FURTHER AGREE THAT IT IS THE COMPLETE AND EXCLUSIVESTATEMENT OF AGREEMENT BETWEEN YOU AND ST THAT SUPERSEDE ANY PRIOR
AGREEMENT, ORAL OR WRITTEN, ANY PROPOSAL AND ANY OTHER COMMUNICATIONS
BETWEEN YOU AND ST RELATING TO THE SUBJECT MATTER OF THIS AGREEMENT.
Address:
The Portland Group
STMicroelectronics, Inc.
Two Centerpointe Dr, Suite 320
Lake Oswego, OR USA 97035
Do you accept these terms? [accept,decline]
accept
———————————————————————————————-
This release of PGI software includes the ACML, which is a tuned
math library designed for high performance on AMD64 machines,
including Opteron(TM) and Athlon(TM) 64, and includes both 32-bit
and 64-bit library versions.
More information about the ACML can be found at the ACML web site:
http://www.developwithamd.com/acml
Install the ACML? [y/n]
—>y
———————————————————————————————-
If you don’t already have permanent keys for this product/release, a
fifteen-day evaluation license can be created now.
Create an evaluation license? [y/n]
—->y
———————————————————————————————-
Do you accept these terms? [accept,decline] accept
Creating temporary license.
Please enter your name: root Please enter your user name: root
Please enter your E-mail address: root@localhost
You have entered the following information:
name root
user name root
E-mail address root@localhost
———————————————————————————————-
License acquired
The above information was saved to /usr/pgi/license.info.
Do you want the files in the install directory to be read-only? [y,n]
——————————->y
———————————————————————————————-
# vi /etc/profile.d/pgi.sh
——————————————————————————–
#!/bin/sh
export PGI=/usr/pgi
export PATH=$PGI/linux86/6.1/bin:$PATH
export MANPATH=$MANPATH:$PGI/linux86/6.1/man
#export LM_LICENSE_FILE=$PGI/license.dat~
~
———————————————————————————————-
# source /etc/profile.d/pgi.sh
# cd /usr/pgi/linux86/6.1/EXAMPLES/linpack/UNIX
# make
# ./linpack
———————————————————————————————-
times are reported for matrices of order 100
sgefa sgesl total Kflops unit ratio
times for array with leading dimension of 201
0.00067 0.00003 0.00069 988024. 0.00202 0.01241
0.00068 0.00003 0.00071 967122. 0.00207 0.01268
0.00074 0.00003 0.00077 894160. 0.00224 0.01371
0.00070 0.00000 0.00070 985693. 0.00203 0.01244
times for array with leading dimension of 200
0.00068 0.00003 0.00070 976632. 0.00205 0.01256
0.00067 0.00003 0.00070 982630. 0.00204 0.01248
0.00067 0.00003 0.00070 976964. 0.00205 0.01255
0.00070 0.00000 0.00070 983865. 0.00203 0.01246
ROLLED DOUBLE PRECISION LINPACK PERFORMANCE 983865 KFLOPS
FORTRAN STOP
———————————————————————————————-
# 전체 노드 동기화 #
—-> ensync /usr/pgi
7-1 mpich + pgi compiler 환경 구축
cc : /usr/pgi/linux86/6.1/bin/pgcc
fc : /usr/pgi/linux86/6.1/bin/pgf77
c++ : /usr/pgi/linux86/6.1/bin/pgCC
# tar zxvf mpich.tar.gz # cd mpich-1.2.7p1
# ./configure –prefix=/usr/local/mpich-pgi -fc=/usr/pgi/linux86/6.1/bin/pgf77 \\
-cc=/usr/pgi/linux86/6.1/bin/pgcc -c++=//usr/pgi/linux86/6.1/bin/pgCC \\
-f90=/usr/pgi/linux86/6.1/bin/pgf90 -f90linker=/usr/pgi/linux86/6.1/bin/pgf90 \\
–with-device=ch_p4 –with-arch=LINUX –enable-f77 –enable-f90modules
# make && make install
# vi /etc/profile.d/mpich-pgi.sh
———————————————————————————————-
#/bin/sh
MPICH_HOME=/usr/local/mpich-pgi
PATH=$MPICH_HOME/bin:$PATH
export MPICH_HOME PATH
———————————————————————————————-
# source /etc/profile.d/mpich-pgi.sh
# cd /usr/local/mpich-pgi/share
# vi machines.LINUX
———————————————————————————————-
# Change this file to contain the machines that you want to use
# to run MPI jobs on. The format is one host name per line, with either
# hostname # or
# hostname:n
# where n is the number of processors in an SMP. The hostname should
# be the same as the result from the command “hostname”
xeon01:4
xeon02:4~
———————————————————————————————-
# cd /usr/local/mpich-pgi/examples
# make
# 전체 노드 동기화 #
—-> enysnc /usr/local/mpich-pgi
8.parall_add test
*** parall_add.c file check ***
# mpicc -o parall_add parall_add.c
# mpirun -np 6 parall_all
——————————————————————————-
*****************************************************
Notice !!
If input is not enough large,
Parallel method is not efficient.
This program will add from 1 to your input.
*****************************************************
Input integer number : 1000000
Parallel SUM = 1784293664, Wall clock time = 0.011654
Serial Sum = 1784293664, Wall clcok time = 0.003077
SPEED UP = 0.264030
Goodbye! : )
————————————————————————————-
9. lammpi 설치 및 설정
# tar zxvf lam-7.1.2.tar.gz
# cd lam-7.1.2
# ./configure –prefix=/usr/local/lam-gcc
# make && make install
# vi /etc/profile.d/lam-gcc.sh
—————————————————————————————-
#!/bin/sh
#LAMHOME=/usr/local/lam-<compiler>
LAMHOME=/usr/local/lam-gcc
PATH=$PATH:/usr/local/lam-gcc/bin
export LAMHOME PATH
———————————————————————————————-
# source /etc/profile.d/lam-gcc.sh
# vi /etc/lamhosts
———————————————————————————————-
xeon01 cpu=4
xeon02 cpu=4
———————————————————————————————-
* 전체 노드 동기화 *
—->ensync lam-gcc
* lammpi 는 일반계정으로 사용 *
# su – king
# lamboot -v -b /etc/lamhosts
———————————————————————————————-
LAM 7.1.2/MPI 2 C++/ROMIO – Indiana University
n-1<31353> ssi:boot:base:linear: booting n0 (xeon01)
n-1<31353> ssi:boot:base:linear: booting n1 (xeon02)
n-1<31353> ssi:boot:base:linear: finished
———————————————————————————————-
# wipe -v -b /etc/lamhosts