Rev | Line | |
---|
[450] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | ## Job Name |
---|
| 4 | #PBS -N r_script |
---|
| 5 | |
---|
| 6 | ## Script to run a script in camelot, IPSL |
---|
| 7 | #PBS -m ae |
---|
| 8 | #PBS -M lluis.fita@lmd.jussieu.fr |
---|
| 9 | |
---|
| 10 | ## Joins standard and Error outputs in a single file |
---|
| 11 | #PBS -j oe |
---|
| 12 | |
---|
| 13 | ## Queue |
---|
[630] | 14 | #PBS -q h12 |
---|
[450] | 15 | |
---|
| 16 | ### Max run time |
---|
| 17 | #PBS -l walltime=12:00:00 |
---|
| 18 | |
---|
| 19 | ### Max memory |
---|
| 20 | #PBS -l vmem=20gb |
---|
| 21 | #PBS -l mem=20gb |
---|
| 22 | |
---|
| 23 | ## resources |
---|
| 24 | #PBS -l nodes=1:ppn=1 |
---|
| 25 | |
---|
| 26 | cd $PBS_O_WORKDIR |
---|
| 27 | |
---|
| 28 | Lscriptname=`expr length ${scriptname}0` |
---|
| 29 | if test ${Lscriptname} -le 1; then |
---|
| 30 | echo "ERROR -- error -- ERROR -- error" |
---|
| 31 | echo " No script name provided!!" |
---|
| 32 | exit |
---|
| 33 | fi |
---|
| 34 | |
---|
| 35 | echo "running '"${scriptname}"' ..." |
---|
| 36 | |
---|
| 37 | dateval=`date "+%Y%m%d%H%M%S"` |
---|
| 38 | |
---|
[537] | 39 | rm -f ${PBS_JOBNAME}.o* |
---|
| 40 | rm -f run_${scriptname}_*.log |
---|
[450] | 41 | |
---|
| 42 | date > run_${scriptname}_${dateval}.log |
---|
| 43 | bash ${scriptname} >& r_script0_${dateval}.log |
---|
| 44 | cat r_script0_${dateval}.log >> run_${scriptname}_${dateval}.log |
---|
[537] | 45 | rm -f r_script0_${dateval}.log |
---|
[450] | 46 | date >> run_${scriptname}_${dateval}.log |
---|
| 47 | |
---|
| 48 | ## e.g. # qsub -v scriptname='WRF_graphics.bash' run_script.pbs |
---|
Note: See
TracBrowser
for help on using the repository browser.