3.创建PBS脚本
[linuxidc@admin~]$touch test.pbs
脚本内容如下
[linuxidc@admin ~]$cat test.pbs
#!/bin/bash
#PBS -N linuxidcjob1
#PBS -j oe
#PBS -l nodes=2:ppn=1
NP=`cat $PBS_NODEFILE | wc -l`
echo "This job's id is $PBS_JOBID@$PBS_QUEUE"
echo "This job's workdir is $PBS_O_WORKDIR"
echo "This job is running on following nodes:"
cat $PBS_NODEFILE
echo "This job begins at:" `date`
echo
echo
cd $PBS_O_WORKDIR
mpirun -np $NP-machinefile $PBS_NODEFILE namd2 apoa1/apoa1.namd
echo
echo
echo "This job stops at:" `date`
[linuxidc@admin ~]$
4.提交任务
[linuxidc@admin ~]$qsub test.pbs
5.查看作业运行状态
[linuxidc@admin~]$qstat
Jobid Name User Time UseS Queue
-------------------------------------------------------- -------- - -----
1.admin linuxidcjob1 linuxidc 0 R batch
[linuxidc@admin~]$qstat -n
admin:
Req'd Req'd Elap
JobID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------------------------------- ---------------- ------ ----- ------ ------ ----- - -----
1.admin linuxidc batch linuxidcjob1 6676 2 2 -- 24:00 R --
node2/0+node1/0
[linuxidc@admin ~]$
由上面可知作业已经在node1和node2上运行了
至此,linux并行集群搭建完成