1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
#!/bin/ksh
###################################################################
# #
# Script ksh pour lancer un calcul Q-Chem en batch #
# #
###################################################################
nodename=$1 ; [ 0 = $# ] || shift
filename=$1 ; [ 0 = $# ] || shift
nodeslist="node0 node1 node2 node4 node5 node6 node7"
jobtime=800:0:0
if [ -z "$filename" ] || [ -z "$jobtime" ]
then
clear
echo " "
echo "==========================================="
echo " submitQChem "
echo " Pour toutes questions contacter : "
echo " A.R. Allouche allouche@lasim.univ-lyon1.fr"
echo "==========================================="
echo "vous devez fournir :"
echo " - le nom du noeud ($nodeslist)"
echo " - le nom du fichier(y compris l'extension .in)"
echo "-------------------------------------------"
echo "Exemple:"
echo " submitQChem node7 h2.in "
echo " fichier de donnees : h2.in"
echo "==========================================="
echo " "
exit 1
fi
ok="false"
for item in $nodeslist ; do
if [ $nodename = $item ]
then
ok="true"
break
fi
done
if [ $ok = "false" ]
then
echo "================================================================"
echo "Sorry $ndoename is not a supported node"
echo "Here is the list of supported nodes : $nodeslist"
echo "================================================================"
exit 1
fi
filecom=$filename
filename=${filecom%.in}
[ "$filename" = "$filecom" ] && filename=${filecom%.inp}
fileout=$filename.out
DEFAULTDIR=`pwd`
TEMPDIR=/tmp
nameUser=$LOGNAME
if test ! -s "$filecom"
then
echo " "
echo "============================================"
echo "le fichier $filecom est introuvable(ou vide)"
echo "============================================"
echo " "
exit 2
fi
endof=EOF
cat > $filename.pbs <<EOF
#!/bin/sh
#PBS -l nodes=$nodename
#PBS -j oe
#PBS -N $filename
#PBS -l walltime=$jobtime
#PBS -o $filename.pbsout
export QC=/home/theochem/rabillou/QChem;
if [ -e \$QC/bin/qchem.setup.sh ] ; then
. \$QC/bin/qchem.setup.sh
fi
export QCAUX=\$QC/aux;
#export ONEEXE="-DONEEXE";
#export QCLOCALSCR= $PBSTMPDIR;
mkdir /tmp/$USER
rm -fr /tmp/$USER/$filename
mkdir /tmp/$USER/$filename
export QCSCRATCH=/tmp/$USER/$filename
cd $DEFAULTDIR
\$QC/bin/qchem $filecom $fileout
EOF
qsub $filename.pbs
echo " "
echo "==================================================================="
echo " "
echo "Un fichier $filename.pbs a ete cree pour lancer le calcul"
echo "Ne pas effacer ce fichier avant la fin du calcul"
echo " "
echo "-------------------------------------------------------------------"
echo " "
echo "pour avoir des informations sur vos job taper : qstat "
echo " "
echo "pour detruire un job taper : qdel num.master0.alin"
echo " num.master0.alin est le Job Id fourni par qstat"
echo " "
echo "==================================================================="
echo " "
|