#! /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 이용법 참조
'리눅스이야기' 카테고리의 다른 글
Raspberry Pi TL-WN725N Wireless 설정 (0) | 2014.05.10 |
---|---|
MPI-ERROR : caused collective abort of all ranks exit status of rank (0) | 2012.06.21 |
kill 명령어 (0) | 2011.01.13 |
linux 상에서 tecplot 창 띄우지 않고 작업하기 (0) | 2010.10.28 |
Acer 3820TG Ubuntu 에서 멀티터치 이용 (0) | 2010.10.11 |