Back to home page

MITgcm

 
 

    


Warning, /verification/fizhi-cs-32x32x40/input/runScript is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit b837625b on 2007-01-11 17:56:31 UTC
b837625b2f Andr*0001 #!/bin/csh
                0002 #
                0003 # Example PBS script to run a job on the myrinet-3 cluster.
                0004 # The lines beginning #PBS set various queuing parameters.
                0005 #
                0006 # o -N Job Name
                0007 #PBS -N fizhi
                0008 #
                0009 #
                0010 # o -l resource lists that control where job goes
                0011 #      here we ask for 3 nodes, each with the attribute "p4".
                0012 #PBS -l nodes=6:p4
                0013 #
                0014 #PBS -q four-twelve
                0015 #
                0016 # o Where to write output
                0017 # #PBS -e TTT.err.$$ 
                0018 #
                0019 # #PBS -o TTT.out.$$
                0020 #
                0021 #
                0022 # o Export all my environment variables to the job
                0023 #PBS -V
                0024 #
                0025 
                0026 echo 'start'
                0027 #----------------------------------------------
                0028 set namPBS=fizhi
                0029 set runDir=/SCRATCH/s04/molod/fizhi-cs-32x32x40/input
                0030 set executable=/SCRATCH/s04/molod/fizhi-cs-32x32x40/build/mitgcmuv
                0031 #-------------------
                0032 # echo 'run in dir :' $runDir
                0033 cd $runDir
                0034 
                0035 set its=`egrep 'nIter0' data | sed 's/ nIter0=//'| sed 's/,$//'`
                0036 
                0037 set numPBS=`echo $PBS_NODEFILE | sed 's/\/usr\/spool\/PBS\/aux\///g'| sed 's/\.cg01//g'`
                0038 
                0039 #-- avoid any output before this point !
                0040 #----------------------------------------------
                0041 #echo $PBS_NODEFILE
                0042 #cat  $PBS_NODEFILE
                0043 #echo 'The list above shows the nodes this job has exclusive access to.'
                0044 #echo 'The list can be found in the file named in the variable $PBS_NODEFILE'
                0045 
                0046 rm -f run_here
                0047 date > run_here
                0048 cat $PBS_NODEFILE >> run_here
                0049 echo 'PBS job Number:' $numPBS >> run_here
                0050 echo on `hostname` run $executable 'in dir:' $runDir >> run_here
                0051 
                0052 #-------------------
                0053 rm -f IamReady
                0054 echo on `hostname` run $executable 'in dir:' `pwd`
                0055 
                0056 #-------------------
                0057 cp -p run_here std_outp
                0058 echo ' ' >> std_outp
                0059 
                0060 cat $PBS_NODEFILE > mf
                0061 set ncpus = ( `wc -l mf | awk '{print $1}'` )
                0062 if ( $ncpus == 1 ) then
                0063  $executable >>& std_outp
                0064  set out=$?
                0065  echo 'end with status' $out
                0066 else
                0067  /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -machinefile mf --gm-kill 5 -v -np $ncpus $executable
                0068  set out=$?
                0069  echo 'end with status' $out
                0070  set out=0
                0071 endif
                0072 
                0073 echo 'Copying datetime file to datetime0 - time is: ' `cat datetime`
                0074 cp datetime datetime0
                0075 
                0076 set ite=`grep CHECKPOINT STDOUT.0000 | grep ckptA | sed 's/(PID.TID 0000.0001) %CHECKPOINT//' | sed 's/ //g' | sed 's/ckptA//'`
                0077 set nitPick = `/home/molod/bin/add0upto10c $ite`
                0078 if ( -f pickup.ckptA.001.001.data ) then
                0079  echo 'file:' pickup.ckptA.001.001.data 'exist'
                0080  if ( $out == 0 ) then
                0081 #- prepare new submission :
                0082  echo 'Copy pickup ckptA files to pickup ' $nitPick 'files'
                0083    mv pickup.ckptA.001.001.data pickup.$nitPick.001.001.data
                0084    mv pickup.ckptA.002.001.data pickup.$nitPick.002.001.data
                0085    mv pickup.ckptA.003.001.data pickup.$nitPick.003.001.data
                0086    mv pickup.ckptA.004.001.data pickup.$nitPick.004.001.data
                0087    mv pickup.ckptA.005.001.data pickup.$nitPick.005.001.data
                0088    mv pickup.ckptA.006.001.data pickup.$nitPick.006.001.data
                0089    mv pickup.ckptA.001.001.meta pickup.$nitPick.001.001.meta
                0090    mv pickup.ckptA.002.001.meta pickup.$nitPick.002.001.meta
                0091    mv pickup.ckptA.003.001.meta pickup.$nitPick.003.001.meta
                0092    mv pickup.ckptA.004.001.meta pickup.$nitPick.004.001.meta
                0093    mv pickup.ckptA.005.001.meta pickup.$nitPick.005.001.meta
                0094    mv pickup.ckptA.006.001.meta pickup.$nitPick.006.001.meta
                0095    mv pickup_fizhi.ckptA.001.001.data pickup_fizhi.$nitPick.001.001.data
                0096    mv pickup_fizhi.ckptA.002.001.data pickup_fizhi.$nitPick.002.001.data
                0097    mv pickup_fizhi.ckptA.003.001.data pickup_fizhi.$nitPick.003.001.data
                0098    mv pickup_fizhi.ckptA.004.001.data pickup_fizhi.$nitPick.004.001.data
                0099    mv pickup_fizhi.ckptA.005.001.data pickup_fizhi.$nitPick.005.001.data
                0100    mv pickup_fizhi.ckptA.006.001.data pickup_fizhi.$nitPick.006.001.data
                0101    mv pickup_fizhi.ckptA.001.001.meta pickup_fizhi.$nitPick.001.001.meta
                0102    mv pickup_fizhi.ckptA.002.001.meta pickup_fizhi.$nitPick.002.001.meta
                0103    mv pickup_fizhi.ckptA.003.001.meta pickup_fizhi.$nitPick.003.001.meta
                0104    mv pickup_fizhi.ckptA.004.001.meta pickup_fizhi.$nitPick.004.001.meta
                0105    mv pickup_fizhi.ckptA.005.001.meta pickup_fizhi.$nitPick.005.001.meta
                0106    mv pickup_fizhi.ckptA.006.001.meta pickup_fizhi.$nitPick.006.001.meta
                0107    mv pickup_vegtiles.ckptA.001.001.data pickup_vegtiles.$nitPick.001.001.data
                0108    mv pickup_vegtiles.ckptA.002.001.data pickup_vegtiles.$nitPick.002.001.data
                0109    mv pickup_vegtiles.ckptA.003.001.data pickup_vegtiles.$nitPick.003.001.data
                0110    mv pickup_vegtiles.ckptA.004.001.data pickup_vegtiles.$nitPick.004.001.data
                0111    mv pickup_vegtiles.ckptA.005.001.data pickup_vegtiles.$nitPick.005.001.data
                0112    mv pickup_vegtiles.ckptA.006.001.data pickup_vegtiles.$nitPick.006.001.data
                0113  echo 'Change start iteration number for next run '
                0114    sed "s/ nIter0=$its/ nIter0=$ite/" data > data.tmp.$numPBS
                0115    mv data.tmp.$numPBS data
                0116    sleep 5
                0117  endif
                0118 else
                0119  echo 'file:' pickup.ckptA.001.001.data 'do not exist !'
                0120  set out=9
                0121 endif
                0122 
                0123 if ( $out != 0 ) then
                0124  echo 'bad return status => STOP here'
                0125  exit $out
                0126 endif 
                0127 
                0128  touch IamReady
                0129   qsub runScript
                0130 
                0131 exit