PC Cluster 使用說明
- 系統環境: Linux Red Hat 7.1 (Kernel 2.4.9)
- 硬體環境:
- Server: CPU Athlon 1.6 GHz RAM 1024MB HD 40GB
- Computing node: CPU Athlon 1.6 GHz RAM 512MB HD 72GB
- Number of computing nodes: 16
- Server IP Address: 140.109.73.31
- 登入帳號: 需預先向資訊室申請
- 連線方式: Exceed(選擇node00) or Putty
(如欲安裝Putty, 請至其網頁, 如需安裝Exceed, 請與資訊室聯絡)
- 程式語言Compiler: f77, gcc, cc, c++, pgf77, pgf90, pgcc, pgCC, mpif77, mpif90, mpicc, mpiCC
- 軟體: R, Maple and Matlab
- Distributive Processing處理原則:當user submit job以後, 系統會由16個computing nodes中, 自動選擇一個free的computing node, dedicated to user's job. 如果目前沒有free的computing node, user's job將會排隊等候!
- Distributive Processing使用程序:
- Example for Frotran programs:
- 將Fortran程式Compile成執行檔(如testpgm, 檔名可自取), 指令如后:
pgf77 -o testpgm testpgm.f (for Fortran 77 program)
pgf90 -o testpgm testpgm.f90 (for Fortran 90 program)
- 編輯一個shell file (如test.sh, 檔名可自取), 內容如后:
#!/bin/sh
#PBS -l walltime=99:00:00
cd $PBS_O_WORKDIR
./testpgm
- Submit Job, 指令如后:
qsub -l nodes=1 test.sh
執行後, 螢幕會立即顯示訊息 XXX.node00.cluster (XXX 為Job number ID)
- 程式執行完畢後, Screen Output 會存成 test.sh.oXXX (XXX 為Job number ID), 存放於目前的目錄
- Example for MPI C programs:
- 將C程式Compile成執行檔(如testpgm, 檔名可自取), 指令如后:
mpicc -o testpgm testpgm.c (for C program)
mpiCC -o testpgm testpgm.c (for C++ program)
- 編輯一個shell file (如test.sh, 檔名可自取), 內容如后:
#!/bin/sh
#PBS -l walltime=99:00:00
cd $PBS_O_WORKDIR
/opt/mpich-pgi/bin/mpirun -np n testpgm
- Submit Job, 指令如后:
qsub -l nodes=n test.sh
執行後, 螢幕會立即顯示訊息 XXX.node00.cluster (XXX 為Job number ID)
- 程式執行完畢後, Screen Output 會存成 test.sh.oXXX (XXX 為Job number ID), 存放於目前的目錄
- Example for MPI Fortran programs:
- 將Fortran程式Compile成執行檔(如testpgm, 檔名可自取), 指令如后:
mpif77 -o testpgm testpgm.f (for Fortran77 program)
mpif90 -o testpgm testpgm.f (for Fortran90 program)
- 編輯一個shell file (如test.sh, 檔名可自取), 內容如后:
#!/bin/sh
#PBS -l walltime=99:00:00
cd $PBS_O_WORKDIR
/opt/mpich-pgi/bin/mpirun -np n testpgm
- Submit Job, 指令如后:
qsub -l nodes=n test.sh
執行後, 螢幕會立即顯示訊息 XXX.node00.cluster (XXX 為Job number ID)
- 程式執行完畢後, Screen Output 會存成 test.sh.oXXX (XXX 為Job number ID), 存放於目前的目錄
- Example for R batch job:
- 編輯R的Batch檔(如test.R, 檔名可自取)
- 編輯一個shell file (如test.sh, 檔名可自取), 內容如后:
#!/bin/sh
#PBS -l walltime=99:00:00
cd $PBS_O_WORKDIR
/usr/bin/R CMD BATCH test.R
- Submit Job, 指令如后:
qsub -l nodes=1 test.sh
執行後, 螢幕會立即顯示訊息 XXX.node00.cluster (XXX 為Job number ID)
- 程式執行完畢後, Screen Output 會存成 test.Rout, 存放於目前的目錄
- Example for Maple batch job:
- 編輯Maple的Batch檔(如maple.in, 檔名可自取)
- 編輯一個shell file (如test.sh, 檔名可自取), 內容如后:
#!/bin/sh
#PBS -l walltime=99:00:00
cd $PBS_O_WORKDIR
/usr/bin/maple < maple.in > maple.out
- Submit Job, 指令如后:
qsub -l nodes=1 test.sh
執行後, 螢幕會立即顯示訊息 XXX.node00.cluster (XXX 為Job number ID)
- 程式執行完畢後, Screen Output 會存成 maple.out, 存放於目前的目錄
- Example for Matlab batch job:
- 編輯Matlab的Batch檔(如poly.m, 檔名可自取)
- 編輯一個shell file (如test.sh, 檔名可自取), 內容如后:
#!/bin/sh
#PBS -l walltime=99:00:00
cd $PBS_O_WORKDIR
/opt/Matlab6p5/bin/matlab < poly.m > poly.out
- Submit Job, 指令如后:
qsub -l nodes=1 test.sh
執行後, 螢幕會立即顯示訊息 XXX.node00.cluster (XXX 為Job number ID)
- 程式執行完畢後, Screen Output 會存成 poly.out, 存放於目前的目錄
- 程式執行完畢後, 錯誤訊息會存成 test.sh.eXXX (XXX 為Job number ID), 存放於目前的目錄
- 可利用指令qstat -ans, 查看Job執行狀態
- 可利用指令qdel XXX (XXX 為Job number ID), 刪除Job