torque作业调度系统安装
系统环境:RHEL6.0
selinux and iptables disabled
1. vi /etc/hosts (所有节点)
192.168.0.82 desktop82.example.com #调度端
192.168.0.82 desktop82.example.com #节点1
192.168.0.76 desktop82.example.com #节点2
~#yum install gcc gcc-c++ tcl-devel tk-devel make -y #安装依赖
~#tar zxf torque-3.0.0.tar.gz
~#cd torque-3.0.0
~#./configure --with-rcp=scp –with-default-server=desktop82.example.com
~#make && make install
~#make packages
~#cd contrib/init.d/
~#cp pbs_server pbs_sched pbs_mom /etc/init.d/
~#scp pbs_mom desktop76.example.com:/etc/init.d/
~#cd torque-3.0.0 #在这个目录
~#scp torque-package-clients-linux-x86_64.sh torque-package-mom-linux-x86_64.sh 192.168.0.76:
~#./torque.setup root
initializing TORQUE (admin: root@desktop82.example.com)
Max open servers: 4
Max open servers: 4
~#cd /var/spool/torque/
~#cd server_priv/
~#vi nodes
desktop82.example.com
desktop76.example.com
~#cd ..
~#cd mom_priv/
~#vi config
$pbsserver desktop82.example.com
$logevent 255
~#qterm -t quick
~#/etc/init.d/pbs_server start
~#/etc/init.d/pbs_sched start
~#/etc/init.d/pbs_mom start
节点安装
[root@desktop76 ~]# ./torque-package-clients-linux-x86_64.sh --install
Installing TORQUE archive...
Done.
[root@desktop76 ~]# ./torque-package-mom-linux-x86_64.sh --install
Installing TORQUE archive...
Done.
[root@desktop76 ~]# cd /var/spool/torque/
[root@desktop76 torque]# ls
aux mom_logs pbs_environment server_name.new undelivered
checkpoint mom_priv server_name spool
[root@desktop76 torque]# cd mom_priv/
[root@desktop76 mom_priv]# ls
jobs
[root@desktop76 mom_priv]# vi config
$pbsserver desktop82.example.com
$logevent 255
[root@desktop76 mom_priv]# /etc/init.d/pbs_mom start
Starting TORQUE Mom: [ OK】
两个测试脚本
vi job1.pbs
#!/bin/bash
#PBS -N job1
#PBS -o job1.log
#PBS -e job1.err
#PBS -q batch
cd /home/wxh
echo Running on hosts `hostname`
echo Time is `date`
echo Directory is $PWD
echo This job runs on the following nodes:
cat $PBS_NODEFILE
echo This job has allocated 1 node
./prog
vi job2.pbs
#!/bin/bash
#PBS -N job2
#PBS -o job2.log
#PBS -e job2.err
#PBS -q batch
#PBS -l nodes=2
cd /home/wxh
echo Time is `date`
echo Directory is $PWD
echo This job runs on the following nodes:
cat $PBS_NODEFILE
NPROCS=`wc -l < $PBS_NODEFILE`
echo This job has allocated $NPROCS nodes
mpiexec -machinefile $PBS_NODEFILE -np $NPROCS ./prog
vi prog
#!/bin/bash
echo 1000000000 | ./icpi-64
chmod +x prog
qsub job1.pbs #提交作业
qstat
Job id Name User Time Use S Queue
------------------------- ---------------- --------------- -------- - -----
0.desktop82 job1 phl 00:00:55 C batch
pbsnodes
desktop82.example.com
state = job-exclusive
np = 1
ntype = cluster
jobs = 0/4.desktop82.example.com
status = rectime=1345343566,varattr=,jobs=,state=free,netload=113125565,gres=,loadave=0.55,ncpus=1,physmem=288352kb,availmem=11338584kb,totmem=11735672kb,idletime=2251,nusers=1,nsessions=2,sessions=2877 1451,uname=Linux desktop82.example.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64,opsys=linux
mom_service_port = 15002
mom_manager_port = 15003
gpus = 0
desktop76.example.com
state = free
np = 1
ntype = cluster
status = rectime=1345343552,varattr=,jobs=3.desktop82.example.com,state=free,netload=101075269,gres=,loadave=0.48,ncpus=1,physmem=288344kb,availmem=12967884kb,totmem=13541040kb,idletime=5884,nusers=1,nsessions=2,sessions=3370 3837,uname=Linux desktop76.example.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64,opsys=linux
mom_service_port = 15002
mom_manager_port = 15003
gpus = 0
qsub job2.pbs #提交作业
qstat
pbsnodes
desktop82.example.com
state = job-exclusive
np = 1
ntype = cluster
jobs = 0/4.desktop82.example.com
status = rectime=1345343608,varattr=,jobs=4.desktop82.example.com,state=free,netload=113180660,gres=,loadave=0.48,ncpus=1,physmem=288352kb,availmem=12953584kb,totmem=13541160kb,idletime=2296,nusers=1,nsessions=2,sessions=2877 1451,uname=Linux desktop82.example.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64,opsys=linux
mom_service_port = 15002
mom_manager_port = 15003
gpus = 0
desktop76.example.com
state = job-exclusive
np = 1
ntype = cluster
jobs = 0/5.desktop82.example.com
status = rectime=1345343597,varattr=,jobs=,state=free,netload=101253719,gres=,loadave=0.27,ncpus=1,physmem=288344kb,availmem=14590964kb,totmem=15346512kb,idletime=5929,nusers=1,nsessions=1,sessions=3370,uname=Linux desktop76.example.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64,opsys=linux
mom_service_port = 15002
mom_manager_port = 15003
gpus = 0