#! /bin/sh
#PBS -N job_test
#PBS -l nodes=1:ppn=4
#PBS -j oe

exef=test.exe
outf=out.1

#-----------make the following universal and unchanged for any user-------------

cd $PBS_O_WORKDIR
jobid=`echo $PBS_JOBID |cut -fl -d"."`
cat $PBS_NODEFILE $PBS_O_WORKDIR/$PBS_JOBNAME.hosts.$jobid

nprocs=`cat $PBS_NODEFILE |wc -l` # total number of processors

echo "Job started on `hostname` at `dat`">$outf
cat $PBS_NODEFILE                       >>$outf
cat $PBS_NODEFILE|sort -u|gawk '{print $1}'>mpd.hosts
num_nodes=`cat mpd.hosts|wc -l`
mpdboot -n $num_nodes
if [ $? -eq "0" ]; then
        echo "mpiexec -machinefile $PBS_NODEFILE -n $nprocs $exef >> $outf" >>$outf
        mpiexec  -machinefile $PBS_NODEFILE -n $nprocs   $exef              >>$outf
        echo "Job Ended at `date`"                                          >>$outf
        mpdallexit
        exit 0
else
        echo "error mpdboot">>$outf
        exit 1
fi

#!/bin/sh
#PBS -l walltime=72:00:00
#PBS -N job_test
#PBS -l nodes=1:ppn=4
#PBS -j oe

# the following give the path for the exe file and the name of the output
 exef=./test.exe
 outf=out.1

# ----- the remaining part need not change -----

 cd $PBS_O_WORKDIR
 jobid=`echo $PBS_JOBID |cut -f1 -d"."`
 # cat $PBS_NODEFILE > $PBS_O_WORKDIR/$PBS_JOBNAME.hosts.$jobid
 nop=$(wc -l $PBS_NODEFILE | awk '{print $1}')

# ----- echo information -----
 echo "Job started on `hostname` at `date`" >> $outf
 echo "Job is running on node(s): " >> $outf
 cat $PBS_NODEFILE                  >> $outf

# ----- start up the mpd daemons and check the mpd ring. -----
startmpd()
{
 echo ' ' >>$outf
 echo ' starting up mpd daemons '
 # create nodefile for use by mpdboot
 # cat $PBS_NODEFILE | sort | uniq -c | awk '{printf("%s:%s\n",$2,$1)}' > mpd.nodes
 cat $PBS_NODEFILE|sort -u|gawk '{print $1}'>mpd.hosts
 num_nodes=`cat mpd.hosts|wc -l`

 mpdboot -n $num_nodes

 sleep 10
 mpdtrace -l
 mpdringtest 100
}

# ----- end mpd deamon -----
endmpd()
{
 echo ' '
 echo ' killing mpd daemons '
 mpdallexit
}

# ----- Execute the run . Do not run in the background. -----
runprogram()
{
if [ $? -eq "0" ]; then
        echo "Job Start at `date`"
        mpiexec -machinefile $PBS_NODEFILE -np $nop $exef >>$outf
        echo "Job Ended at `date`"
else
        echo "error mpdboot"
fi
}

# ----- "qdel" command is used to kill a running job -----
early()
{
 echo ' '
 echo ' ######## WARNONG : EARLY TERMINATION ######## '
 echo ' '
}

trap 'early; stageout' 2 9 15

##################################################
# Full sequence                                  #
##################################################
startmpd
runprogram
endmpd

# -----
exit 0


mpd daemon 이용법 참조
Posted by 스핏파이어
,




클러스터에서 Fluent 이용방법.1(x-window 이용시)

 

1) 클러스터에 접속

 

2) 개인 PC에서 Exceed 를 실행시킨다.(실행하지 않을 경우 외부에서 창 띄우기 불가)

 

3) 명령창에 다음과 같이 입력

$ export DISPLAY=210.119.***.***:0.0 ! 여기서 본인 IP 입력

 

4) 플루언트 이용시 다음과 같이 입력

$ fluent (계산조건) -t(사용할 cpu 수) -pnmpi -cnf=./(호스트파일)&

 

계산조건 : 2d, 2ddp, 3d, 3ddp

호스트파일 : 이용하고자 하는 노드 번호 및 cpu 개수,

호스트 파일은 반드시 이용하는 폴더 아래에 있어야함

SSH의 FTP 창을 이용하여 폴더 생성 및 복사 , 삭제 가능

 

ex) 3ddp 조건으로 cpu 4개를 이용하고자하는 경우(호스트 파일명은 host)

$ fluent 3ddp -t4 -pnmpi -cnf=./host&

 

5) 즐겁게 이용~~


* infiniband 이용시

호스트 파일에 node001i:12 식으로 i 첨부

실행명령어 옵션에  -pib.infinipath  추가

 

클러스터에서 Fluent 이용방법.2(Qsub 이용시)

 

1) 클러스터에 접속

 

2) 개인 PC에서 Fluent를 실행하여 Case file 및 Data file을 생성

!Case file 생성 시, Model, Boundary Condition, Solver, Residual 등의 각 Setting을 완료함.

!Autosave를 설정해 주어야 주기적으로 Data file을 확인할 수 있음

 

3) 명령창에 다음과 같이 입력 (추가적인 job command 는 매뉴얼 참고)

$ vi job.cmd

file

read-case-data

(cas file명).cas← 이 file명의 case file과 data file을 같이 read함

quit

solve

iterate (iterate하고자 하는 횟수)

quit

file

write-case-data

(저장하고자 하는 file명).cas

yes (중복되는 file명의 경우)

quit

exit

yes

 

(esc키 - :키 - wq - enter키)


#PBS -N (job이름)

#PBS -l nodes=(사용할 node수):ppn=2:hpc1,walltime=30:00:00

#PBS -q hpc1

#PBS -j oe

#

# Move to the directory where the job was submitted from

# you could also 'cd' directory to your working directory

#

cd $PBS_O_WORKDIR

#

 

 

# Create new hostfile

#

cat $PBS_NODEFILE | uniq | awk '{ print $1 ":2"}' > fluenthost

 

NOP=$(wc -l $PBS_NODEFILE | awk '{print $1}')

#

# Run Fluent

#

/home002/Fluent6.3.26/Fluent.Inc/bin/fluent 2d -g -t

$NOP -pethernet -cnf=$PBS_NODEFILE -i job.cmd >> out.1

 

(esc키 - :키 - wq - enter키)


   run.pbs


$ qsub fluent.pbs

 

4) GUI창을 통해 Residual을 확인할 수 없으므로 다음과 같이 확인

$ tail out.1

- Residual 상태를 수치로 확인 가능

 

5) 접속을 끊어도 Cluster는 계산 수행 가능

 

6) emergence kill 경우 $sh kill-fluent *** 명령을 이용해서 작업내용 삭제


Posted by 스핏파이어
,



hpc3 클러스터에서 총 87 개 cpu 이용시 예


#PBS -l nodes=10:ppn=8:hpc3+1:ppn=7:hpc3,walltime=100:00:00


또는


#PBS -l nodes=10:ppn=8+1:ppn=7


젠장...이것 하나때문에 얼마나 시간을 많이 보냈는데;;; ㅠㅠ





* 참고자료...

[torqueusers] request odd number of cpus when using ppn=2

Glen Beane glen.beane at gmail.com
Tue Oct 21 13:48:44 MDT 2008
On Tue, Oct 21, 2008 at 3:40 PM, Brock Palen <brockp at umich.edu> wrote:

> How could a user request 25 cpus? For example code has a master process
> that controls several 2 thread MPI ranks.
>
> Thus jobs should be laid out:
>
> 1 2 2 2 2 2 etc,
>
> I tried:
>
> -l nodes=5:ppn=2+nodes=1

-l nodes=5:ppn=2+1:ppn=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/torqueusers/attachments/20081021/3fc44fb3/attachment.html


More information about the torqueusers mailing list
Posted by 스핏파이어
,