[클러스터] Teragon HPC Config HOWTO 문서

====================================================================

             Teragon HPC Config HOWTO 문서

====================================================================

        * 본 문서는 클루닉스 기술부의 HPC 기본 설치 문서 입니다.

        * 본 문서는 대외비에 해당하니, 작성자의 허가 없이는 외부 유출을

        * 금합니다.

                       작성자 : 클루닉스 기술부 서 진우(alang@clunix.com)

                       작성일 : 2004년 9월 17일

————————————————————————-

**** 내용 :

        

          1. rlogin, rsh 설치 및 설정

          2. dua, dush 설치 및 사용 방법

          3. nfs 설정 및 사용 방법 ( automountd )

          4. network channel 이중화

          5. time sync

          6. compiler 설치 ( intel, pgi )

          7. 공학 계산용 Library 설치 하기 ( blas, lapack, atlas, fft )

          8. MPI 프로그램 설치 및 설정 ( compiler 연동 )

1. rlogin. rsh 설치

rlogin, rsh 관련 서비스를 구동하기 위해서는 rsh, rsh-server 두개의 패키지가 설치가 되어져 있어야 한다.

먼저 xinetd 데몬에서 rsh, rlogin 서비스를 사용할 수 있도록 설정을 변경한다.

# vi /etc/xinetd.d/rsh

—————————————————————————–

service shell

{

        disable = no

        socket_type             = stream

        wait                    = no

        user                    = root

        log_on_success          += USERID

        log_on_failure          += USERID

        server                  = /usr/sbin/in.rshd

}

—————————————————————————–

# vi /etc/xinetd.d/rlogin

—————————————————————————–

service login

{

        disable = no

        socket_type             = stream

        wait                    = no

        user                    = root

        log_on_success          += USERID

        log_on_failure          += USERID

        server                  = /usr/sbin/in.rlogind

}

—————————————————————————–

설정을 변경한 후 xinetd 데몬을 restart 한다.

# /etc/rc.d/init.d/xinetd restart

# vi /etc/securetty

—————————————————————————-

.

..



rsh

rlogin

—————————————————————————-

rsh, rlogin 서비스를 허용할 hosts 와 users 설정을 한다.

# vi /etc/hosts

—————————————————————————–

127.0.0.1                        localhost                

# 계산용 네트워크

192.168.10.254                master                

192.168.10.1                node01

192.168.10.2                node02

192.168.10.3                node03

192.168.10.4                node04

192.168.10.5                node05

192.168.10.6                node06

.

# 관리용 네트워크

—————————————————————————–

# vi /etc/hosts.equiv

—————————————————————————–

master

node01

node02

node03

node04

node05

node06

.

.

—————————————————————————–

# vi $HOME/.rhosts

—————————————————————————–

master

node01

node02

node03

node04

node05

node06

.

.

—————————————————————————–

.rhosts 설정에서는 각 노드간의 rsh 접속이 동일한 계정 사이에서만 기본적으로 이루어 진다. 만일 clunix 계정으로 root 의 권한으로 rsh 접속을 하기 위해서는 root 의 .rhosts 에 아래와 같이 해 주어야 한다.

# vi /root/.rhosts

—————————————————————————–

master

node01

node02

node03

node04

node05

node06

master                clunix

node01                clunix

node02                clunix

node03                clunix

node04                clunix

node05                clunix

node06                clunix

—————————————————————————–

2. dua, dush 설치/ 설정

dua, dush 는 Encluster-HPC 의 다중 서버 관리 도구이다. 즉 여러대의 서버에 file 및 작업 명령을 일괄적으로 처리하도록 해주는 프로그램이다.

dua, dush 를 정상적으로 사용하기 위해서는 앞에서 설명한 rsh, rlogin 서비스 설정 이 완료되어 있어야 한다.

먼저 Master Node 에 dutil-1.2.1-1.noarch.rpm 를 설치 한다.

# rpm -Uvh dutil-1.2.1-1.noarch.rpm

실제 dua, dush 를 이용하여 일괄 괄리할 서버 리스트를 작성한다.

# vi /usr/clx/etc/nodelist

——————————————————————————

master

node01

node02

node03

node04

node05

node06

——————————————————————————

** dua : file 을 nodelist 에 포함된 모든 Node 에게 일괄적으로 sync 시키는 도구

** dush : nodelist 의 포함된 node 에게 일괄적으로 내려진 작업을 수행한다.

공통 옵션 설명 :

-l : /usr/clx/etc/nodelist 이외의 다른 nodelist 를 참조할 경우 -l 옵션으로 호출

할수 있다.

예) dua -l /etc/nodelist /root

-n : nodelist 에 포함된 모든 node 가 아닌 특정 node 에만 작업을 수행할 경우 사용됨

예) dua -n node03 /root

-p : 작업을 순차적으로 처리하는 것이 아닌 backgroud mode 로 동시에 작업이 수행된다

예) dush -p “/etc/rc.d/init.d/ecmctl restart”

-s : 노드간 수행 결과를 구분하기 위한 ###executing…” 이란 메세지가 나타나지 않고

수행 결과만을 출력해 주는 옵션이다.

-d : dua 에서 사용되는 옵션으로 디렉토리간의 완전한 sync 를 할때 사용된다.

즉 master 와  node02 의 디렉토리 내용을 완전히 sync 시킬때 사용되는 옵션으로

그냥 # dua /root 라 수행하면 master 의 /root 내용이 node02 의 /root 로 파일이

복제 되지만 # dua -d /root 라 수행하면 node02가 master 보다 더 많은 파일을

가지고 있다면 master 에 없는 파일은 모두 삭제해 버리고 완전 master 와 동일한

자료만을 가지게 된다.

3. nfs 설정

# vi /etc/exports

—————————————————————————–

# NFS 원격 설치 시 사용되는 경로

/data/clunix/teragon        *(ro,no_root_squash)

# 사용자 Data 보관에 이용되는 경로

/data/users                                *(rw,no_root_squash)

—————————————————————————–

# /etc/rc.d/init.d/portmap restart

# /etc/rc.d/init.d/nfs restart

이것을 HPC에 적절한 Nfs 설정이 완료된다.

# mount -t nfs master:/data/clunix/teragon  /mnt/teragon

# mount -t nfs master:/data/users  /mnt/users

등의 잘 nfs mount 가 되는 지를 확인한다.

– nfs 설정 후 사용자에게 nfs 디스크를 활당해 주는 방안..

홈디렉토리 자체를 nfs 상에 만들면 nfs 에 문제가 있을때 로그인이 될수가 없다.

이를 피하기 위해서는 홈디렉토리는 로컬 하드 상에 만들고 홈디렉토리 밑에 data 파일

을 nfs 디스크 상에 링크 형태로 만들어 대용량 파일을 이곳에 보관하는 방식으로

설정한다.

먼저 /nfs 디렉토리의 퍼미션을 1777 로 하여 자신의 파일에만 제어 권한을 준다.

# chmod 1777 /nfs

# vi /etc/skel/.bashrc

—————————————————————-

userid=`whoami`

if [ ! -d /nfs/$userid/ ]

then

mkdir /nfs/$userid

ln -sf /nfs/$userid $HOME/data

else

chown -R $userid. /nfs/$userid

fi

—————————————————————

위 스크립터에서 /nfs 는 실제 nfs 디렉토리라고 생각해야 한다.

[root@node00 root]# df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/hda3             10080520    148852   9419600   2% /

/dev/hda1               202220     14518    177262   8% /boot

none                    514940         0    514940   0% /dev/shm

/dev/hda2             10080520   1547244   8021208  17% /usr

/dev/hda6              2016016    200712   1712892  11% /var

/dev/hda7              9775216    512684   9262532   6% /usr/local

/dev/hda8             43534780     32848  43501932   1% /home

/dev/sda5            234429320     32840 234396480   1% /data1

node00:/data1        234429320     32840 234396480   1% /nfs

와 같이..

사용자 계정을 만들고 처음 로그인을 하면 nfs 상에 자신의 이름으로 디렉토리

를 만든다. 그런후 자신의 홈디렉토리 및에 data 란 파일로 링크를 건다.

만일 /nfs 파일 밑에 이미 자신의 이름과 동일한 디렉토리가 있으면 ..

그냥 자신의 퍼미션으로 퍼미션 변경만을 하게 된다.

todo : sudo 를 이용하여 퍼미션 변경하기, 현재 nfs 상태를 체크하기

– automount 를 이용하여 사용자에게 nfs 공간을 활당하는 방안

automount 에는 am-utils ( amd ), autofs 두가지의 패키지가 있다.

Redhat9 에서는 기본적으로 autofs 를 체택하고 있다.

간단한 설정에 대해 알아보자.

주요 설정 파일은 ..

/etc/auto.master

/etc/auto.misc

이 있다.

# vi /etc/auto.master

======================================================================

/home         /etc/auto.user01   –timeout=5

# vi /etc/auto.user01

======================================================================

user01/data         -fstype=nfs,rw,soft,bg      master:/data/nfs/user01

# /etc/rc.d/init.d/portmap restart

# /etc/rc.d/init.d/autofs restart

/home/user01/data 로 이동하면 자동으로 master 의 /data/nfs/user01

로 nfs mount 가 된다.

automount 를 사용하게 되면 실제 사용자가 지정된 mount point 에 접근 시에만

자동으로 nfs mount 하고 일정 시간 사용을 하지 않으면 자동으로 umount 를 시

키기 때문에 nfs 서비스로 인한 resource 를 최대한 절약 할 수 있고, 여러명이

지속저으로 Nfs 를 사용할 경우 1개의 곳에서 lock 이 결려도 전체 서비스에 문

제가 생길 가능성이 있는데 automount 로 상당 부분 해소할 수 있다.

autofs-4.x 버전에서는 multiple hostname 기능이 지원한다.

이는 먼저 master 로 Connection 요청을 해서 정상적인 요청이 이루어 지지

않으면 slave 에 연결이 된다. Redhat9 에서는 기본적으로 autofs-3.x 임으로

autofs-4.x 로 업그레이드를 해야 한다.

http://www.kernel.org/pub/linux/daemons/autofs/

4. network channel 분리 설정 ( 관리/nfs[파일], 계산 )

# vi /etc/hosts

——————————————————-

# useing administration , file service

192.168.0.254                node00

192.168.0.1                node01

192.168.0.2                node02

.

.

.

# useing real node – calculation, computation

192.168.10.254                real00

192.168.10.1                real01

192.168.10.2                real02

.

.

.

——————————————————-

nfs 설정 및 dua,dush 의 hostlist 는 모두 nodexx 로 지정하고

lammpi 등의 lamhost 등은 모두 realxx 로 지정하여 실제 관리 및 파일 서비스에

이용되는 네트워크 채널과 계산에 이용되는 네트워크 채널을 분리하여 사용한다.

5. time sync 설정

– master node 에 time 서버스를 켠다.

vi /etc/xinetd.d/time

————————————————-

service time

{

        disable = no

        type            = INTERNAL

        id              = time-stream

        socket_type     = stream

        protocol        = tcp

        user            = root

        wait            = no

}                      

————————————————

/etc/rc.d/init.d/xinetd restart

– master node 의 시간을 표준 시간으로 맞춘다.

# hwclock -w

# rdate -s time.bora.net

– read node 에서 master node 시간과 일치 시킨다.

# rdate -s master

– master node 에서 시간이 일치하는지 확인한다.

# dush date

– master node 에서 time sync 스크리터를 하나 만들고 cron 에 매 시간 마다

한번씩 실행 시켜 준다.

# vi /root/bin/timesync

———————————————————————–

#!/bin/sh

hwclock -w

rdate -s time.bora.net

/usr/clx/sbin/dush rdate -s master_node

———————————————————————–

# vi /root/bin/timeview

———————————————————————-

#!/bin/sh

/usr/clx/sbin/dush date | grep -v executing

———————————————————————

# crontab -e

———————————————————————–

0 * * * * /root/bin/timesync

———————————————————————–

/etc/rc.d/inint.d/crond restart

# /root/bin/timeview

[node00] Tue May 11 18:49:39 KST 2004

[node01] Tue May 11 18:49:39 KST 2004

[node02] Tue May 11 18:49:39 KST 2004

[node03] Tue May 11 18:49:39 KST 2004

[node04] Tue May 11 18:49:39 KST 2004

[node05] Tue May 11 18:49:39 KST 2004

———————————————————————-

6. Compiler 설치

– intel fortran/c++ Compiler 설치

intel Compiler 설치 방법은 모두 동일하다. 주의할것은 .lic 파일을 설치 디렉토리

에 넣어두시고 install.sh을 실행하면 된다.

ftp://clunix@technet.clunix.com/Hpc/intel

# tar xvf l_cc_p_8\\[1\\].0.055.tar

# mv l_cpp_63460285.lic l_cc_p_8.0.055

# cd l_cc_p_8.0.055

# ./install.sh

// compiler 설치 경로 -> /usr/local/intel

# vi /etc/profile.d/intel.sh

——————————————————————

#!/bin/sh

PATH=$PATH:/usr/local/intel/bin

export PATH

—————————————————————–

– PGI Compiler 설치하기 (옵테론용)-(IA32도 동일)

ftp://clunix@technet.clunix.com/Hpc/pgi-amd64

ftp://www.pgroup.com

# cd /usr/local/src/pgi-amd64/

# tar xzvf linux86-64[1].tar.gz

# ./install

—————————————————————–

End-User License

NOTICE: PLEASE READ THIS DOCUMENT CAREFULLY BEFORE DOWNLOADING,

COPYING OR USING THE SOFTWARE.  THIS END-USER LICENSE AGREEMENT

(“ELA”) IS A LEGAL AGREEMENT BETWEEN YOU, THE LICENSEE (A SINGLE

PERSON, INSTITUTION, OR LEGAL ENTITY), AND STMicroelectronics, INC. A

DELAWARE CORPORATION WITH ITS PRINCIPAL PLACE OF BUSINESS AT 1310

ELECTRONICS DRIVE, CARROLTON, TX 75006 (“ST”) FOR THE SOFTWARE,

ASSOCIATED MEDIA, PRINTED MATERIAL, ELECTRONIC DOCUMENTATION OR ANY

PORTION THEREOF. BY INSTALLING AND USING THE SOFTWARE ACCOMPANYING

THIS ELA INDICATES YOUR ACCEPTANCE OF THESE TERMS AND

CONDITIONS. PLEASE NOTE THAT YOU MAY NOT USE, COPY, MODIFY OR TRANSFER

THE SOFTWARE OR DOCUMENTATION OR ANY COPY, EXCEPT AS EXPRESSLY

PROVIDED IN THIS ELA.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS

.

.

Address:

        The Portland Group Compiler Technology

        STMicroelectronics

        9150 SW Pioneer Court, Suite H

        Wilsonville, OR  97070

        USA

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 를 입력한다.

——————————

following license.

LICENSE AGREEMENT

AMD CORE MATH LIBRARY

IMPORTANT: This is a legal agreement (“Agreement”) between you, either

as an individual or an entity, (the “USER”) and Advanced Micro Devices,

Inc. (“AMD”).  By loading the software or any portion thereof

(“Software”), and any related documentation (“Documentation”), USER

agrees to all of the terms of this Agreement.  Additionally, USER

remains subject to the original terms and conditions of any other

software license agreements entered into by USER and a third party.

USER is responsible for ensuring that use of the Software provided by

AMD is not in violation of any such agreement.

.

.

Do you accept these terms? [accept,decline]

-> accept 를 입력한다.

——————————

Please specify the directory path under which the software will be

installed.  The default directory is /usr/pgi, but you may

install anywhere you wish, assuming you have permission to do so.

Installation directory? [/usr/pgi]

-> 그냥 Enter 혹은 PGI 를 설치할 경로를 입력한다.

————————————————–

Installing software into /usr/pgi (this may take some time).

#############################################

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 를 입력한다. ( evaluation license 생성할건지 물어봄..) -> 15일 사용가능

.

.

PGI Software: PGI Fortran/C/C++ compilers and tools for 32-bit x86

and 64-bit AMD64 processor-based computer systems.  

Do you accept these terms? [accept,decline]

-> accept 를 입력한다.

——————————–

Creating temporary license.

Please enter your name: root    -> root 를 입력한다.

Please enter your user name: root -> root 를 입력한다.

Please enter your E-mail address: root@localhost -> root를 입력한다.

You have entered the following information:

        name                 root

        user name            root

        E-mail address       root@localhost

Do you wish to change anything? [yes/no]:  -> no

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

를 선택하면 됩니다.

—————————————————————–

# cd /usr/pgi 가셔서 정상적으로 설치가 완료되었는지를 확인함.

그런후 반드시 /etc/profile.d 및에 다음 환경 설정을 넣어 둠.

# vi pgi.sh

—————————————————————–

export PGI=/usr/pgi

PATH=${PGI}/linux86-64/5.1/bin:$PATH

—————————————————————–

# cp pgi.sh /etc/profile.d

# sourc /etc/profile.d/pgi.sh

# pgf77 test.f

—————————————————————–

NOTE: your evaluation license will expire in 14 days, 23.9 hours.

For a permanent license, please read the order acknowledgement

that you received.  Connect to https://www.pgroup.com/License with

the username and password in the order acknowledgement.

        Name:   root

        User:   root

        Email:  root@localhost

        Hostid: PGI=000C76E0827FB855DE54B8

PGFTN-F-0002-Unable to open source input file: test.f

—————————————————————-

같이 메세지가 떨어지면 정상적으로 설치가 되어진것이다.

간단한 테스트를 해보기 위해서는 소스에서 제공하는 샘플 소스를 컴파일

해 볼수 있다.

# cd /usr/pgi/linux86/5.1/EXAMPLES/linpack/UNIX

# make

# ./linpkrd

—————————————————————————-

     norm. resid      resid           machep         x(1)-1        x(n)-1

  1.89264926E+00  8.39915160E-14  2.22044605E-16 -6.22835117E-14 -4.16333634E-14

    times are reported for matrices of order   100

      sgefa      sgesl      total     Kflops       unit      ratio

times for array with leading dimension of 201

    0.00115    0.00004    0.00119    578917.    0.00345    0.02118

    0.00114    0.00004    0.00118    582486.    0.00343    0.02105

    0.00112    0.00004    0.00116    589944.    0.00339    0.02078

    0.00117    0.00000    0.00117    585947.    0.00341    0.02093

times for array with leading dimension of 200

    0.00113    0.00004    0.00117    587926.    0.00340    0.02086

    0.00113    0.00004    0.00117    586895.    0.00341    0.02089

    0.00113    0.00004    0.00117    587817.    0.00340    0.02086

    0.00117    0.00000    0.00117    585409.    0.00342    0.02095

ROLLED DOUBLE  PRECISION LINPACK PERFORMANCE       585409 KFLOPS

FORTRAN STOP

—————————————————————————-

그럼 이시스템의 CPU Flops 를 체크하는 linpack 체크를 할수 있다.

7. Library 설치 하기 ( blas, lapack, atlas, fft )

8. MPICH, LAMMPI 설치 / 설정 하기

– lammpi 설치/설정하기

http://lammpi.org/download

# tar xzvf lam-7.0.5.tar.gz

# cd lam-7.0.5

# ./configure –prefix=/usr/local/lam

// intel compiler 적용시 //

# ./configure –prefix=/usr/local/lam –with-fc=ifc –with-cc=icc –with-cxx=icc

// 단 /etc/ld.so.config 에 intel 관련 라이브러리 경로를 적어줘야 함. 아님 configure

시 에러남.

만일 PGI 컴파일러 설치 시는 아래 configure 를 참조 한다.

# ./configure –prefix=/usr/local/lam –with-fc=/usr/pgi/linux86-64/5.1/bin/pgf77 –with-cc=/usr/pgi/linux86-64/5.1/bin/pgcc –with-cflags=-DDEC_ALPHA

위는 AMD64bit Opteron 환경에서 적용한것으로 32bit 환경에서는 마지막 –with-cflags=-DDEC_ALPHA 옵션을 제거한다.

–with-cxx=pgCC (closs compile) 를 추가할 필요가 있을 시는 추가하도록 한다.

# make

# make install

# vi /etc/basrhrc

————————————————————-

LAMHOME=/usr/local/lam

PATH=$PATH:/usr/local/lam/bin

export LAMHOME PATH

————————————————————

# vi /etc/lamhost

————————————————————

real00

real01

real02

real03

real04

real05

.

.

————————————————————

Cpu 가 smp 인 경우에는 ..

# vi /etc/lamhost

————————————————————

real00 cpu=2

real01 cpu=2

real02 cpu=2

real03 cpu=2

real04 cpu=2

real05 cpu=2

.

.

————————————————————

lamd 을 실행한다. lamd 은 root 가 아닌 일반 계정에서 실행하여야 한다.

보안을 생각하면 lamd 의 퍼미션을 750 으로 주고 lamusers 란 그룹을 만들어서

hpcusers 란 그룹에 속한 유저만 실행 가능토록 한다.

$ lamboot -v -b /etc/lamhosts

// lamd 에 의해 계산에 참여한 노드 리스트

$ lamnodes  

// lamd 중지

$ wipe -v -b /etc/lamhosts    

$ mpicc -o ring ring.c

$ mpirun -np 8 ./ring    

이런식으로 테스트를 하면 된다.

PGI Compiler 와 연동할 경우 ..

./configure –prefix=/usr/local/lam –with-fc=/usr/pgi/linux86/bin/pgf90 –with-cxx=/usr/pgi/linux86/bin/pgCC –with-cc=/usr/pgi/linux86/bin/pgcc

만일 lamboot 수행시 SSI boot modules 에러가 발생하면 –with-boot=rsh 를 붙여준다.

– mpich 설치 /설정하기

wget ftp://ftp.mcs.anl.gov/pub/mpi/mpich.tar.gz

# ./configure –prefix=/usr/local/mpich -cc=/usr/pgi/linux86/5.1/bin/pgcc -fc=/usr/pgi/linux86/5.1/bin/pgf90 -c++=/usr/pgi/linux86/5.1/bin/pgCC –with-device=ch_p4 –with-arch=LINUX -flinker=/usr/pgi/linux86/5.1/bin/pgf90

# make

# make install

# cp /usr/local/mpich/share

# vi machines.LINUX

——————————————————————–

# host_name:cpu_num

otn1:2

otn2:2

otn3:2

# cd /usr/local/mpich/examples

# /usr/local/mpich/bin/mpicc -o cpi cpi.c

# /usr/local/mpich/bin/mpirun -np 2 cpi

——————————————————————–

Process 0 on otn1

Process 1 on otn2

pi is approximately 3.1416009869231241, Error is 0.0000083333333309

wall clock time = 0.000000

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

페이스북/트위트/구글 계정으로 댓글 가능합니다.